Hello everybody,
how can I separate the date from the time ?
Name of the variable is created_at.
2014-10-22T19:13:48Z
I tried this code:
gen ddate = daily(substr(created_at, 1, 10), "YMD")
gen double ctime = clock(substr(created_at, 12, 12), "hms")
but I only got an output for date and not for the time.
Thanks.
Related Posts with separate time and date
Trouble Exporting a Table 1 Into a PDF Directly From Stata CommandsHi all, I am currently doing research, so I will use a sample example from this link to ask my quest…
Creating Annual/Yearly VariableHello Statalisters, I need to generate an annual variable from 2014 to 2020 in my data set. Current…
Spatial Panel Data and Spatial Weight MatrixHi all, I use Stata 17 to create a spatial panel dataset of more than 3000 US counties and 5 time p…
Question (Omitted for multicollinearity)Dear all, I am running some regressions in which I want to investigate the role of foreign technolo…
Panel Cointegration for data with gaps in the time seriesHello, I have panel data N=19 and T=29 with gaps in the time series. I need to do cointegration. The…
Subscribe to:
Post Comments (Atom)
0 Response to separate time and date
Post a Comment