toLocal method

JDate toLocal()

Returns this JDate value in the local time zone.

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

new JDate.fromMicrosecondsSinceEpoch(microsecondsSinceEpoch,
                                        isUtc: false)

Implementation

JDate toLocal() {
  if (isUtc) {
    return isJs
        ? JDate.fromMillisecondsSinceEpoch(_millisecondsSinceEpoch,
            isUtc: false)
        : JDate.fromMicrosecondsSinceEpoch(_microsecondsSinceEpoch,
            isUtc: false);
  }
  return this;
}