Dear Colleagues
Please help: I am trying to extract the first 8 characters (NEWdate) from a date format (OLDdate) which has timestamp in it.
OLDdate's format is %tc
OLDdate
14jan2011 00:00:00
NEWdate
14jan2011
I have tried the two commands below and they dont seem to work:
gen NEWdate = substr(OLDdate, 1, 9))
format NEWdate %td
gen NEWdate = dt(OLDdate_Date, 1, 9)
format NEWdate %td
Thanks for your help.
Regards
Fadzai
Related Posts with Extracting subset date from a timestamp date variable
Robust / Clustered standard errorsHello together,
I have a question regarding the application of standard errors in case of heteroske…
Testing the significance of the autocorrelation coefficient at various lags in time seriesDear all,
I want to test if a time series is autocorrelated. So I calculated the sample autocorrela…
covert string variable into data
Hello, how can I covert this string variable into Date to be like 2021-06-30
Code:
* Example gen…
downloading stata datasetHi
I have this do-file with cd "C:\Users\Dropbox\\Data Sets\Stata" and I don't know how to download …
How to read the anticipation effect result in difference-in-difference?Hi all, I am using did_imputation package following Borusyak,2021
The way of testing is:
Estim…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting subset date from a timestamp date variable
Post a Comment