Mingfeng wrote:
Is there a way to tell Stata to recognize a time stamp like this, with
both date and time?
11JAN02:10:45:41
I know how to read in the two parts separately (the date 11JAN02 and
the time 10:45:41) but don't know how to read them in together, so
that Stata not only knows 11JAN02:10:45:41 is different from
12JAN02:10:45:41, but can also give a meaningful calculation (such as
the difference between the two times, most likely in terms of
seconds).
---------------------------------------------------------
Official Stata does not (yet?) handle this, but there are good unofficial
commands. Try:
findit date time
Among many other things it points to:
SJ-6-1 dm0018 . . . . . . . . . . . . . . . Speaking Stata: Time of day
(help ntimeofday, stimeofday if installed) . . . . . . N. J. Cox
Q1/06 SJ 6(1):124--137
converting back and forth between string and numeric
representations for time-of-day calculations
Hope this helps
Svend
________________________________________________________
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C, Denmark
Phone, work: +45 8942 6090
Phone, home: +45 8693 7796
Fax: +45 8613 1580
E-mail: [email protected]
_________________________________________________________
*
* 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/