Dear all,
I am reporting an issue I encountered when importing a xlsx-dataset into Gretl. The dataset has two columns, one of which is a date field in the format "M/D/YYYY". When I import this dataset into Gretl, the date column is displayed as numeric values instead of the expected date format.
I am unable to recognize the relationship between the date values in the original Excel file and the numeric values shown in Gretl. This behavior suggests a potential bug in the data import functionality of Gretl.
For the attached data, I obtain the following values in Gretl:
unit edatum
1 1 28825
2 2 28825
3 3 40725
4 4 41487
5 5 32721
I would greatly appreciate your assistance in resolving this problem.
Best regards,
Artur
The numbers you're seeing are the raw numeric form of Microsoft Excel dates: number of days since 1900-01-01. Gretl tries to handle MS dates as dates if they appear in the first column of a dataset and seem to indicate a time series structure. Those conditions are not satisfied here. Values in columns other the first are always just interpreted as plain numerical values or string values, so in this case you get the raw numbers. If you want to include dates in columns other than the first, in such a way that gretl can manipulate them as dates, you must put them in the form of strings, or canonical ISO-8601 "basic" 8-digit integers.
In short, this is not a bug.
Thanks for clarification, Allin. I am going to close the ticket.
By the way, if I'm not mistaken, the excel convention is to count days from 1/1/1900, so you could turn your data into proper ISO dates by going through epoch days, as in
Thanks for the concrete example, Jack. I am going to add this to the wiki.