Hello everyone,
I'm having a (possibly) silly issue with the conversion of a string into a datetime. In particular, the string is displaying day-month-year hour:minute:second (02-Jan-2022 03:00:00) and I used the following commands to create a dateime
gen datetime_3h = clock(standard_time, "DMYhms")
format datetime_3h %tc
which, however does not do it exactly as it generates, for the specific case, 02jan2022 03:00:28.
I have attached the screenshot of the dataset with the newly-generated variable.
Do you know how I can fix this and get 02jan2022 03:00:00 exactly?
Thank you
I'm having a (possibly) silly issue with the conversion of a string into a datetime. In particular, the string is displaying day-month-year hour:minute:second (02-Jan-2022 03:00:00) and I used the following commands to create a dateime
gen datetime_3h = clock(standard_time, "DMYhms")
format datetime_3h %tc
which, however does not do it exactly as it generates, for the specific case, 02jan2022 03:00:28.
I have attached the screenshot of the dataset with the newly-generated variable.
Do you know how I can fix this and get 02jan2022 03:00:00 exactly?
Thank you

Comment