[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Date format

From (William Gould, StataCorp LP)
Subject   Re: st: Date format
Date   Thu, 30 Aug 2007 11:03:39 -0500

E. Paul Wileyto <> writes, 

> We have a lot of programming that is dependent on dates.  Now when I run
> the ODBC import under version 10, I get this huge number in %tc format,
> instead of just the date, which I gather is now the %td format.
> Is there a quick conversion from a %tc value to a %td value that I can
> plug in to make all the old code work?

Assume variable x contains a %tc value, which is a date and time.  You can
contain the corresponding %d value (which is a date) via 

        . gen date = dofc(x)

You could replace the values in x via 

        . replace x = dofc(x)

-- Bill
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index