I have a variable containing strings in the following format
StringVar
"2018-12-27 14:28:41.4861930"
I would like to convert it into a variable with a time format STATA will recognize, keeping the precision to the millisecond level. E.g. the # of milliseconds since 1960 would be perfect.
I tried among other things the following, but it delivered only missing values.
gen time2=clock(StringVar,"DMYhms")
Any ideas?
Thank you for the help...
Related Posts with Convert string to time including milliseconds
Can I use tssmooth for a fixed number of periods like a rolling forecast, safe the forecast t+5, then start in t+1, save forecast t+6...Hello everybody, I'm trying to forecast values for the strategy of companies. I have a panel datase…
Guarantee 3 consecutive observations before and after the eventDear Stata Users, I need to keep just those firms (gvkey) that have 3 year consecutive observations…
Generate a moving window averageIs there an easy way to generate a moving window average? For instance, for every 5 minutes of Ta_NO…
Calibration of logistic regression on large dataset.Evaluating goodness-of-fit for a logistic regression model using the Hosmer-Lemeshow test is not rel…
Weak IV test postestimation test when using ivreghdfe command?Dear STATA community, I am hoping you can help me find a command I am looking for. My coauthor and …
Subscribe to:
Post Comments (Atom)
0 Response to Convert string to time including milliseconds
Post a Comment