GLib.DateTime.new_now

function new_now(tz: GLib.TimeZone): GLib.DateTime {
    // Gjs wrapper for g_date_time_new_now()
}
  

Creates a GLib.DateTime 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 the system clock is set to truly insane values (or unless GLib is still being used after the year 9999).

You should release the return value by calling GLib.DateTime.prototype.unref when you are done with it.

Since 2.26

tz

a GLib.TimeZone

Returns

a new GLib.DateTime, or null