W3cubDocs

/Dart 2

toLocal method

DateTime toLocal()

Returns this DateTime value in the local time zone.

Returns this if it is already in the local time zone. Otherwise this method is equivalent to:

DateTime.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch,
                                    isUtc: false)

Implementation

DateTime toLocal() {
  if (isUtc) {
    return DateTime._withValue(_value, isUtc: false);
  }
  return this;
}

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-core/DateTime/toLocal.html