Dear all,
I am dealing with an apparently easy task. I am trying to combine in one column of date-time, two separate columns containing respectively a date and a time. The date is stored in date format (counting the number of days from January 1st, 1960); the time is stored as SIF datetime/c format. To combine them, I created the datetime column. But the result is quite surprising because the time is always wrong by a couple of seconds. Here is the code I used to obtain the results that are in the data set extract enclosed.
I tried to look at previous posts but no one seems to deal with the problem...
Many thanks in advance for your help.
Riccardo
I am dealing with an apparently easy task. I am trying to combine in one column of date-time, two separate columns containing respectively a date and a time. The date is stored in date format (counting the number of days from January 1st, 1960); the time is stored as SIF datetime/c format. To combine them, I created the datetime column. But the result is quite surprising because the time is always wrong by a couple of seconds. Here is the code I used to obtain the results that are in the data set extract enclosed.
Code:
gen time=Clock(activation_time, "hms") format time %tcHH:MM:SS gen datetime=date*24*60*60*1000+time format datetime %tCDD/NN/CCYY_HH:MM:SS
Many thanks in advance for your help.
Riccardo
Comment