[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Time/Date query
I have a query regarding transforming a date read into Stata as a string
variable which I need to translate into a numeric variable (and then store
in Stata's %tc format). I'd be grateful if anyone has any idea what I'm
doing wrong. It falls over when I use the -clock- function. But after studying
the help pages am still not sure why! The error message is r(133) "Unknown
set obs 1
ge str23 stringdate = "2001-02-31 11:12:13.000"
ge double mydate = clock(stringdate, "YMD hms") Format mydate %tc
The line generating mydate produces the error message.
I have read Stata's help page for dates and times at:
And off this page is a page for help with "String to numberic translation
Which contains an example identical to mine above.
I am using Intercooled Stata v9.2.
Thanks in advance!
Dr. Christopher J Gerry
Lecturer in European Economics
Programme Director IMESS
UCL School of Slavonic and East European Studies
16, Taviton Street, London
Tel: + 44 (0)207 679 8759; Fax: +44 (0)207 679 8777
* For searches and help try: