Hi everyone,
A very quick question about date variables:
I want to transform a string variable written as "MM/DD/YYYY hh:mm:ss"into a %tc format as the one mentionned in the title.
The hours-minutes-seconds are always "00:00:00, 01:00:00, 02:00:00, 03:00:00, etc".
I tried that but not worked:
Could anyone provide me a solution please? Thank you.
Michael
A very quick question about date variables:
I want to transform a string variable written as "MM/DD/YYYY hh:mm:ss"into a %tc format as the one mentionned in the title.
The hours-minutes-seconds are always "00:00:00, 01:00:00, 02:00:00, 03:00:00, etc".
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str17 Date "07/01/21 00:00:00" "07/01/21 01:00:00" "07/01/21 02:00:00" "07/01/21 03:00:00" "07/01/21 04:00:00" "07/01/21 05:00:00" "07/01/21 06:00:00" "..." end
Code:
gen times = date(Date, "MDYhhmmss") (4,416 missing values generated)
Michael
Comment