Package net.time4j.tz

Interface TransitionStrategy


public interface TransitionStrategy

Serves for resolving of local timestamps to a global UNIX timestamp, escpecially if there are conflicts due to gaps or overlaps on the local timeline.

Note: All implementations must be immutable and serializable.

Author:
Meno Hochschild
  • Method Details

    • resolve

      long resolve(GregorianDate localDate, WallTime localTime, Timezone timezone)

      Calculates a suitable global timestamp for given local timestamp.

      The nanosecond fraction of given wall time will not be taken into account.

      Parameters:
      localDate - local calendar date in given timezone
      localTime - local wall time in given timezone
      timezone - timezone data containing offset history
      Returns:
      global timestamp as full seconds since UNIX epoch (posix time)
      Since:
      1.2.1
      See Also:
      TimeScale.POSIX, PlainTimestamp.in(Timezone), Timezone.with(TransitionStrategy)
    • getOffset

      ZonalOffset getOffset(GregorianDate localDate, WallTime localTime, Timezone timezone)

      Calculates a suitable offset for given local timestamp.

      Parameters:
      localDate - local calendar date in given timezone
      localTime - local wall time in given timezone
      timezone - timezone data containing offset history
      Returns:
      ZonalOffset
      Since:
      1.2.1
      See Also:
      PlainTimestamp.in(Timezone), Timezone.with(TransitionStrategy)
    • using

      default TransitionStrategy using(OverlapResolver resolver)

      Tries to change the overlap handling.

      The default implementation does nothing.

      Parameters:
      resolver - strategy how to handle ambivalent mappings during an offset overlap
      Returns:
      possibly adjusted transition strategy
      Since:
      3.32/4.27