DateTime
Creates a #GDateTime corresponding to this exact instant in UTC.
This is equivalent to calling g_date_time_new_now() with the time zone returned by g_time_zone_new_utc().
Return
a new #GDateTime, or null
Since
2.26
Creates a new #GDateTime corresponding to the given date and time in the time zone @tz.
The @year must be between 1 and 9999, @month between 1 and 12 and @day between 1 and 28, 29, 30 or 31 depending on the month and the year.
Return
a new #GDateTime, or null
Since
2.26
Parameters
a #GTimeZone
the year component of the date
the month component of the date
the day component of the date
the hour component of the date
the minute component of the date
the number of seconds past the minute
Creates a #GDateTime corresponding to the given ISO 8601 formatted string
Return
a new #GDateTime, or null
Since
2.56
Parameters
an ISO 8601 formatted time string.
a #GTimeZone to use if the text doesn't contain a timezone, or null.
⚠️ Deprecated ⚠️
This is deprecated since version 2.62.
#GTimeVal is not year-2038-safe. Use g_date_time_new_from_unix_utc() instead.
Creates a #GDateTime corresponding to the given #GTimeVal @tv in UTC.
The time contained in a #GTimeVal is always stored in the form of seconds elapsed since 1970-01-01 00:00:00 UTC.
This call can fail (returning null) if @tv represents a time outside of the supported range of #GDateTime.
You should release the return value by calling g_date_time_unref() when you are done with it.
Return
a new #GDateTime, or null
Since
2.26
Parameters
a #GTimeVal
Creates a #GDateTime corresponding to the given Unix time @t in UTC.
Unix time is the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC.
This call can fail (returning null) if @t represents a time outside of the supported range of #GDateTime.
You should release the return value by calling g_date_time_unref() when you are done with it.
Return
a new #GDateTime, or null
Since
2.26
Parameters
the Unix time
Creates a new #GDateTime corresponding to the given date and time in UTC.
This call is equivalent to calling g_date_time_new() with the time zone returned by g_time_zone_new_utc().
Return
a #GDateTime, or null
Since
2.26
Parameters
the year component of the date
the month component of the date
the day component of the date
the hour component of the date
the minute component of the date
the number of seconds past the minute
Creates a #GDateTime corresponding to this exact instant in the given time zone @tz. The time is as accurate as the system allows, to a maximum accuracy of 1 microsecond.
This function will always succeed unless GLib is still being used after the year 9999.
You should release the return value by calling g_date_time_unref() when you are done with it.
Return
a new #GDateTime, or null
Since
2.26
Parameters
a #GTimeZone