View Source Timex.PosixTimezone (timex v3.7.11)

Used when parsing POSIX-TZ timezone rules.

Link to this section Summary

Functions

Obtains a NaiveDateTime representing the end of DST for this zone.

Obtains a NaiveDateTime representing the start of DST for this zone.

Returns a boolean indicating if the datetime provided occurs during DST of the given POSIX timezone.

Returns a Calendar.TimeZoneDatabase compatible map, representing this timezone for the given datetime

Returns a TimezoneInfo struct representing this timezone for the given datetime

Link to this section Types

@type rule_bound() ::
  {{:julian_leap, 0..365}, Time.t()}
  | {{:julian, 1..365}, Time.t()}
  | {{:mwd, {month :: 1..12, week :: 1..5, day_of_week :: 0..6}}, Time.t()}
  | nil
@type t() :: %Timex.PosixTimezone{
  dst_abbr: nil | String.t(),
  dst_end: rule_bound(),
  dst_offset: integer(),
  dst_start: rule_bound(),
  name: nil | String.t(),
  std_abbr: nil | String.t(),
  std_offset: integer()
}

Link to this section Functions

@spec dst_end(t(), DateTime.t() | NaiveDateTime.t() | Date.t()) ::
  NaiveDateTime.t() | nil

Obtains a NaiveDateTime representing the end of DST for this zone.

Returns nil if there is no DST period.

Link to this function

dst_start(posix_tz, date)

View Source
@spec dst_start(t(), DateTime.t() | NaiveDateTime.t() | Date.t()) ::
  NaiveDateTime.t() | nil

Obtains a NaiveDateTime representing the start of DST for this zone.

Returns nil if there is no DST period.

@spec is_dst?(t(), DateTime.t() | NaiveDateTime.t() | Date.t()) :: boolean()

Returns a boolean indicating if the datetime provided occurs during DST of the given POSIX timezone.

Link to this function

to_period_for_date(tz, date)

View Source

Returns a Calendar.TimeZoneDatabase compatible map, representing this timezone for the given datetime

Link to this function

to_timezone_info(tz, date)

View Source
@spec to_timezone_info(t(), DateTime.t() | NaiveDateTime.t() | Date.t()) ::
  Timex.TimezoneInfo.t()

Returns a TimezoneInfo struct representing this timezone for the given datetime