compare


Description:

public int compare (DateTime dt)

A comparison function for date-times that is suitable as a [type@GLib.

CompareFunc].

This effectively converts both date-times to the same time zone before comparing, so date-times in different time zones can compare equal if they refer to the same instant. See [method@GLib.DateTime.difference].

Both date-times must be non-`NULL`.

Parameters:

this

first date-time to compare

dt2

second date-time to compare

Returns:

`-1`, `0` or `1` if this is less than, equal to or greater than dt2