Statalist


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

Re:st: ISO 8601 date-time format in Stata 10


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re:st: ISO 8601 date-time format in Stata 10
Date   Thu, 23 Aug 2007 00:44:20 -0700

Finally got it.  It just took a little more playing with it.

Joseph Coveney


. set obs 1
obs was 0, now 1

. generate str datetime_s = "2007-08-22T23:54:00"

. generate double datetime_n = clock(datetime_s, "YMD#hms")

. format datetime_n %tcCCYY-NN-DD!THH:MM:SS

. list, noobs abbreviate(15)

 +-------------------------------------------+
 |          datetime_s            datetime_n |
 |-------------------------------------------|
 | 2007-08-22T23:54:00   2007-08-22T23:54:00 |
 +-------------------------------------------+



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index