Type Alias (GI Alias)

GLib-2.0GLibTimeDeprecated 2.62

Time: number

Simply a replacement for time_t. It has been deprecated since it is not equivalent to time_t on 64-bit platforms with a 64-bit time_t.

Unrelated to GLib.Timer.

Note that GLib.Time is defined to always be a 32-bit integer, unlike time_t which may be 64-bit on some systems. Therefore, GLib.Time will overflow in the year 2038, and you cannot use the address of a GLib.Time variable as argument to the UNIX time() function.

Instead, do the following:

time_t ttime;
GTime gtime;

time (&ttime);
gtime = (GTime)ttime;

since 2.62: This is not Y2038-safe. Use GLib.DateTime or time_t instead.