Hello,
I am new to Stata and am working with a pre-existing dataset. I am trying to figure out how a particular numeric date-time variable was converted from a string variable d_date_start_s, as I want to use the same method to convert a new set of string date-time values into numeric form. An example of the string value format is "Jan 27, 2023 7:38:03 am", which has the corresponding numeric value 23037. I tried to construct a new numeric variable from d_date_start_s to see if it would give me the same format by running
generate double numvar = clock(d_date_start_s, "MDYhms")
but this just generated missing values.
As far as I can tell, the Datetime Conversion manual doesn't include this exact string date/time format so any help would be appreciated.
I am new to Stata and am working with a pre-existing dataset. I am trying to figure out how a particular numeric date-time variable was converted from a string variable d_date_start_s, as I want to use the same method to convert a new set of string date-time values into numeric form. An example of the string value format is "Jan 27, 2023 7:38:03 am", which has the corresponding numeric value 23037. I tried to construct a new numeric variable from d_date_start_s to see if it would give me the same format by running
generate double numvar = clock(d_date_start_s, "MDYhms")
but this just generated missing values.
As far as I can tell, the Datetime Conversion manual doesn't include this exact string date/time format so any help would be appreciated.
Comment