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
Need help on ordering options in VAR modelHello, I have two questions. 1. What ordering options are available other than Cholesky Decompositio…
Need help estimating tail expectationsHi all, I am currently trying to calculate the Marginal expected shortfall (MES) based on the follo…
Need help on ordering options in VAR modelHello, I have two questions. 1. What ordering options are available other than Cholesky Decompositio…
Total Factor Productivity Measurement through Production Function ApproachI intend to measure the TFP of manufacturing firms for 23 states through Production Function Approac…
Saving coefficients in a columnDear All, I estimate a spatial regression model and then I calculate the marginal impact of the reg…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting subset date from a timestamp date variable
Post a Comment