GLib.DateTime.compare

function compare(dt1: void, dt2: void): Number(gint) {
    // Gjs wrapper for g_date_time_compare()
}
  

A comparison function for #GDateTimes that is suitable as a GLib.CompareFunc. Both #GDateTimes must be non-null.

Since 2.26

dt1

first GLib.DateTime to compare

dt2

second GLib.DateTime to compare

Returns

-1, 0 or 1 if dt1 is less than, equal to or greater than dt2.