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
 Generating group variables under changing group constellationHello Statalisters,
I have a dataset with each row equaling one team member (see below). These team… Generating group variables under changing group constellationHello Statalisters,
I have a dataset with each row equaling one team member (see below). These team…
 firm address to panel datadear all,
I have data about companies' addresses, zip code, and state as follows. Where begQ and en… firm address to panel datadear all,
I have data about companies' addresses, zip code, and state as follows. Where begQ and en…
 Heckman correction for hedonic regressionsHi everyone,
using EHCP micro data, I am trying to predict the rent that households in social housin… Heckman correction for hedonic regressionsHi everyone,
using EHCP micro data, I am trying to predict the rent that households in social housin…
 Using aextlogit with missing data and continous predictorsMy dataset has 995 adolescents who completed questionnaires over T=2 timepoints. I am focusing on ex… Using aextlogit with missing data and continous predictorsMy dataset has 995 adolescents who completed questionnaires over T=2 timepoints. I am focusing on ex…
 Hirfindahl-Hirschman calculationHi Guys,
For my research I need firm complexity as a control variable.
The way in which well-known… Hirfindahl-Hirschman calculationHi Guys,
For my research I need firm complexity as a control variable.
The way in which well-known…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting subset date from a timestamp date variable
Post a Comment