diff --git a/glib/gdatetime.c b/glib/gdatetime.c index 3be4eba3d..f8bf31c43 100644 --- a/glib/gdatetime.c +++ b/glib/gdatetime.c @@ -1194,6 +1194,11 @@ get_iso8601_seconds (const gchar *text, gsize length, gdouble *value) if (length > 2 && !(text[i] == '.' || text[i] == ',')) return FALSE; + + /* Ignore leap seconds, see g_date_time_new_from_iso8601() */ + if (v >= 60.0 && v <= 61.0) + v = 59.0; + i++; if (i == length) return FALSE; @@ -1431,6 +1436,10 @@ parse_iso8601_time (const gchar *text, gsize length, * [ISO 8601 formatted string](https://en.wikipedia.org/wiki/ISO_8601) * @text. ISO 8601 strings of the form