toUtc method

  1. @override
UtcDateTime toUtc()
override

Returns this DateTime value in the UTC time zone.

Returns this DateTime if it is already in UTC. Otherwise this method is equivalent to:

DateTime.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch,
                                    isUtc: true)

Implementation

@override
// ignore: invalid_use_of_protected_member
UtcDateTime toUtc() => _utc ??= UtcDateTime(year, month, day)..datePart = this;