Hello,
I have a dataset imported from Excel which contains variables that are date / time combination. They would be in the format for instance "18feb2022 15:23:04". However, in Stata the cell values appear as this "44608.5557626273" stored as type str16, format %-9s.
I have successfully translated the integer part prior to the decimal point, using the Excel date format with a base of 1 Jan. 1900. di %td date after subtraction 44608 - 21914 produces 18feb2022. But then don't know how to deal with the decimal after (that should be hh:mm:ss of that day). di %tc decimaldate - 21914 produces: 01jan1960 00:00:22
Thank you for any help.
I have a dataset imported from Excel which contains variables that are date / time combination. They would be in the format for instance "18feb2022 15:23:04". However, in Stata the cell values appear as this "44608.5557626273" stored as type str16, format %-9s.
I have successfully translated the integer part prior to the decimal point, using the Excel date format with a base of 1 Jan. 1900. di %td date after subtraction 44608 - 21914 produces 18feb2022. But then don't know how to deal with the decimal after (that should be hh:mm:ss of that day). di %tc decimaldate - 21914 produces: 01jan1960 00:00:22
Thank you for any help.
Comment