|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: converting elapsed days to date.
As Maarten points out, -format- will display an elapsed
date in conventional notation.
If on the other hand you truly want to "reverse this"
and separate out the components of an elapsed date, then
see the functions -year()-,-month()-, and -day()-.
. gen year=year(stdate)
Jeph
Maarten buis wrote:
--- Ashim Kapoor <[email protected]> wrote:
I understand that if I have the month , day ,year I can do
gen stdate= mdy(month,day,year)
is there a way I can "reverse this" ie. given the elapsed days can I
figure out todays date in the format 20080828 for say today?
Yes, you use -format-, see: -help format-
-- Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
Send instant messages to your online friends http://uk.messenger.yahoo.com
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/