Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: transform date


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: transform date
Date   Wed, 3 Mar 2004 10:00:21 -0000

1.1.1980 is ambiguous on whether day.month.year
or month.day.year. No matter; you know, so 

di %tw  wofd(date("1.1.1980", "dmy")) 

or 

di %tw  wofd(date("1.1.1980", "mdy")) 

as appropriate shows a way to proceed. 

Given  a variable say -mydate-

gen week = wofd(date(mydate, "dmy")) 

etc. 

Nick 
n.j.cox@durham.ac.uk 

Martin Ebert
> 
> I have a little problem to transform dates in a daily format 
> (1.1.1980)
> to dates in a stata elapsed weekly format. Can Stata do this
> proceedure?

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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