toUtc method

Instant toUtc()

Returns this Instant value in the UTC time zone.

Returns this if it is already in UTC.

Implementation

Instant toUtc() => (timeZoneOffset == 0) ? this : Instant.fromDateTime(DateTime.utc(1970, 1, 1).add(sinceEpoch));