Hi,

I am trying to convert R dates into STATA dates but unable to do so.

For example, the R date in POSIXct format is 1231084800 this is number of seconds from 1970-01-01 00:00. The actual date in MDY format is "Jan 4th, 2009"

I followed the process described here - https://www.stata.com/manuals/ddatet...ersoftware.pdf

generate double statatime = rtime - tC(01jan1970 00:00)
format statatime %tC

But STATA gives the answer as "14jan1950 05:58:04" which is wrong.

How to I get the correct date and how can I fetch month, year, day values from the date?

Thanks!