Ambiguous parsing of the ISO date string
We have two types of functions to parse a string and extract time:
gda_parse_iso8601_.... The date-specific function
gda_parse_iso8601_date was designed with the following restrictions (taken from the documentation):
Accepted date format is "YYYY-MM-DD" (more or less than 4 digits for years and less than 2 digits for month and day are accepted). Years must be in the 1-65535 range, a limitation imposed by GDate.
As can be seen, this is not a valid ISO format. Under ISO 999 < year < 10000 and must be restricted to 4 digits. As a result, some tests become confusing. For instance,
g_date_time_new_from_iso8601() returns `NULL' if year part is not a valid ISO format. The possible solution could be:
- Restrict the current implementation of the
gda_parse_iso8601_...to pure ISO style (4-digit year) AND
- Add new API similar to
gda_parse_iso8601_...and with similar signature, e.g.
gda_parse_date(). An appropriate message can be added to the current
gda_parse_iso8601_datefor developers to redirect them to the new API.
I am porting right now
tests/test-input-parsers.c to Glib-test and found multiple issues related to the parsing date/time.