Hi all,
I have a large set of string variables (too large to encode) that contain dates and specific times in the following manner:
09SEP19:09:00:00
I would like to convert it to dates using either
gen new_date_var = date(string_var, "DMY###")
gen new_date_var = clock(string_var, "DMY#hms")
However none of these work apparently because of the : between the Year and the Time (---19:09---) and therefore the new_date_var generates only missing values.
I also tried to use multiple # to account for the additional : but it is not working.
I would highly appreciate any help =)
Thank you for your time!
Related Posts with String to date variable with time when string does not follow the format DMY ## or DMYhms
Invalid name Error when using postHi Statalist, I was running regressions in loop and trying to store coefficients. I used post for t…
Runby corr, error: store_data(): 3900 unable to allocate real <tmp>Hello, I am working on a project where I need to runby the corr program and return the correlation …
Help with time-trend analysisI have a database of the volume of a certain type of test across time. I want to show how the trend …
Exporting nbreg regression (negative binomial regression) to include alphaHow can I export a nbreg regression to include the alpha value and show its significance using the s…
tnbreg does not convergeI am trying to run a Zero-Truncated Negative Binomial Regression with the attached data. The code I …
Subscribe to:
Post Comments (Atom)
0 Response to String to date variable with time when string does not follow the format DMY ## or DMYhms
Post a Comment