g_time_val_from_iso8601 doesn't handle YYYY-MM-DD dates correctly.
For instance, when debugging Liferea with:
time_t
date_parse_ISO8601 (const gchar *date)
{
GTimeVal tv;
gboolean b;
g_warning ("Date: %s", date);
b = g_time_val_from_iso8601 (date, &tv);
if (b == TRUE) {
gchar *s;
s = g_time_val_to_iso8601 (&tv);
g_warning (" was: %s", s);
g_free (s);
}
return (time_t)tv.tv_sec;
}
I get:
** (liferea:10394): WARNING **: Date: 2011-12-24
** (liferea:10394): WARNING **: was: 1970-08-18T05:43:44Z
** (liferea:10394): WARNING **: Date: 2011-12-22
** (liferea:10394): WARNING **: was: 1970-08-18T06:35:12Z
Note: if g_time_val_from_iso8601 isn't meant to support YYYY-MM-DD
dates (the current documentation is unclear), then the returned
boolean should not be true!