I am trying to convert my String Time (modified_date) which is formatted in:
2015-10-28 11:09:47.000
I would like to convert it into stata time
In the interim I would like to generate a new variable to make sure I don't mess up my original data base
these are my commands
1. encode modified_date, gen (Statadate_DMY)
2. date (Statadate_DMY, "YMDhms")
3. format Statadate_DMY %td
For
1: I want to use the data in modified_date to be transferred into my new variable Statadate_DMY
2. Telling Stata to convert the string time into Stata time
3. Telling stata to convert the stata time into human readable time
It doesn't seem to work - I do get a blue value, but the format is %23.0g
Apologies I just started using stata....sorry if it's a silly question
2015-10-28 11:09:47.000
I would like to convert it into stata time
In the interim I would like to generate a new variable to make sure I don't mess up my original data base
these are my commands
1. encode modified_date, gen (Statadate_DMY)
2. date (Statadate_DMY, "YMDhms")
3. format Statadate_DMY %td
For
1: I want to use the data in modified_date to be transferred into my new variable Statadate_DMY
2. Telling Stata to convert the string time into Stata time
3. Telling stata to convert the stata time into human readable time
It doesn't seem to work - I do get a blue value, but the format is %23.0g
Apologies I just started using stata....sorry if it's a silly question
Comment