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
Asdoc mixed regression || inclusion not workingHi everyone. I'm trying to export the results of my mixed methods ordered regression using the asdoc…
Matrix of sums of submatricesI have matrix A. I'd like to create a new matrix B where each element is the sum of a corresponding …
AsdocHi, I am using asdoc to produce some mean difference tests (ttest). How can I change the names of t…
Replacing string values with numerical valuesHi everyone, I'm working on a project using multiple tennis data sets (initially csv files, using a…
How to Use Stata Code to Count How Many Students ever took More Than 1 Time Exam?I have a small dataset and it just has 2 variables. ID---student ID, exam_times----how many times a …
Subscribe to:
Post Comments (Atom)
0 Response to Convert string to time including milliseconds
Post a Comment