DateTime defines a single DateTime type instance.
The returned date is always represented in UTC.
Example:
constdt0=newDateTime() // now
// full datetime string constdt1=newDateTime('2023-07-01 00:00:00.000Z')
// datetime string with default "parse in" timezone location // // similar to new DateTime('2023-07-01 00:00:00 +01:00') or new DateTime('2023-07-01 00:00:00 +02:00') // but accounts for the daylight saving time (DST) constdt2=newDateTime('2023-07-01 00:00:00', 'Europe/Amsterdam')
Compare compares the current DateTime instance with u.
If the current instance is before u, it returns -1.
If the current instance is after u, it returns +1.
If they're the same, it returns 0.
Equal reports whether the current DateTime and u represent the same time instant.
Two DateTime can be equal even if they are in different locations.
For example, 6:00 +0200 and 4:00 UTC are Equal.
DateTime defines a single DateTime type instance. The returned date is always represented in UTC.
Example: