toDateTimeLocal method

DateTime toDateTimeLocal()

Constructs a DateTime from this value which has a DateTime.isUtc == false;

If the date and time is not on a millisecond\microsecond boundary (the unit of granularity of DateTime on web\vm), the value will be truncated towards the start of time.

Returns: A DateTime value for the same date and time as this value.

Implementation

DateTime toDateTimeLocal() {
  var isUtc = DateTimeZone.local == DateTimeZone.utc;
  return isUtc ? inUtc().localDateTime._toDateTimeLocalUtc() : _toDateTimeLocal();
}