Hi everyone
In my dataset I have a time variable. It is in format: %tcDay_Mon_DD_HH:MM:SS_CCYY (this is variable “Date”). Storage type float.
According to the ddatetime.pdf I should be able to extract for example year from that variable.
I have tried both:
gen RegYear = clockpart(Date, “year”) and
gen RegYear = datepart(Date, "year")
But both generates an error message (for clockpart): unknown function clockpart() r(133);
What am I doing wrong?
All the best!