DateTime.newFromIso8601

glib.date_time.DateTime newFromIso8601(string text, glib.time_zone.TimeZone defaultTz = null)

Creates a #GDateTime corresponding to the given

ISO 8601 formatted string

text. ISO 8601 strings of the form <date><sep>

Note that as #GDateTime "is oblivious to leap seconds", leap seconds information in an ISO-8601 string will be ignored, so a 23:59:60 time would be parsed as 23:59:59.

<sep> is the separator and can be either 'T', 't' or ' '. The latter two

separators are an extension from

RFC 3339. <date> is in the form:
  • YYYY-MM-DD - Year/month/day, e.g. 2016-08-24.
  • YYYYMMDD - Same as above without dividers.
  • YYYY-DDD - Ordinal day where DDD is from 001 to 366, e.g. 2016-237.
  • YYYYDDD - Same as above without dividers.
  • YYYY-Www-D - Week day where ww is from 01 to 52 and D from 1-7,

e.g. 2016-W34-3.

  • YYYYWwwD - Same as above without dividers.