reinterpretTimezone method

Hora reinterpretTimezone(
  1. HoraTimezone targetTimezone
)

Reinterprets this wall-clock into targetTimezone, changing instant.

Implementation

Hora reinterpretTimezone(HoraTimezone targetTimezone) {
  if (!isValid) return this;
  final newMicros = unixMicros +
      utcOffset.inMicroseconds -
      targetTimezone.offset.inMicroseconds;
  return Hora.fromTimestamp(
    newMicros,
    locale: locale,
    utc: true,
    unit: UnixTimestampUnit.microseconds,
  );
}