From 2efbc5e2ddeb7ca80d1cb0ebb0427360fd4a7b76 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 29 Feb 2024 02:20:18 +0000 Subject: [PATCH] build based on f9d0dcf --- dev/api-private/index.html | 2 +- dev/api-public/index.html | 2 +- dev/arithmetic/index.html | 2 +- dev/conversions/index.html | 2 +- dev/current/index.html | 2 +- dev/faq/index.html | 2 +- dev/index.html | 2 +- dev/rounding/index.html | 2 +- dev/search/index.html | 2 +- dev/types/index.html | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dev/api-private/index.html b/dev/api-private/index.html index 0bfccdea..206a1b13 100644 --- a/dev/api-private/index.html +++ b/dev/api-private/index.html @@ -44,4 +44,4 @@ 1919-09-16 2:00s 0 - 1944-04-03 2:00s 1:00 Ssource

Interpretation

TimeZones.transition_rangeFunction
transition_range(dt::DateTime, tz::VariableTimeZone, context::Type{Union{Local,UTC}}) -> UnitRange

Finds the indexes of the tz transitions which may be applicable for the dt. The given DateTime is expected to be local to the time zone or in UTC as specified by context. Note that UTC context will always return a range of length one.

source
TimeZones.interpretFunction
interpret(dt::DateTime, tz::VariableTimeZone, context::Type{Union{Local,UTC}}) -> Array{ZonedDateTime}

Produces a list of possible ZonedDateTimes given a DateTime and VariableTimeZone. The result will be returned in chronological order. Note that DateTimes in the local context typically return 0-2 results while the UTC context will always return 1 result.

source
TimeZones.shift_gapFunction
shift_gap(local_dt::DateTime, tz::VariableTimeZone) -> Tuple

Given a non-existent local DateTime in a TimeZone produces a tuple containing two valid ZonedDateTimes that span the gap. Providing a valid local DateTime returns an empty tuple. Note that this function does not support passing in a UTC DateTime since there are no non-existent UTC DateTimes.

Aside: the function name refers to a period of invalid local time (gap) caused by daylight saving time or offset changes (shift).

source
TimeZones.first_validFunction
first_valid(local_dt::DateTime, tz::VariableTimeZone, step::Period)

Construct a valid ZonedDateTime by adjusting the local DateTime. If the local DateTime is non-existent then it will be adjusted using the step to be after the gap. When the local DateTime is ambiguous the first ambiguous DateTime will be returned.

source
TimeZones.last_validFunction
last_valid(local_dt::DateTime, tz::VariableTimeZone, step::Period)

Construct a valid ZonedDateTime by adjusting the local DateTime. If the local DateTime is non-existent then it will be adjusted using the step to be before the gap. When the local DateTime is ambiguous the last ambiguous DateTime will be returned.

source

TZFile

TimeZones.TZFile.readFunction
TZFile.read(io::IO) -> Function

Read the content of an I/O stream as a POSIX tzfile to produce a TimeZone. As the tzfile format does not include the name of the interpreted time zone this function returns a closure which takes the single argument name::AbstractString and when called produces a TimeZone instance.

source
TimeZones.TZFile.writeFunction
TZFile.write(io::IO, tz::TimeZone; version::Char=TZFile.WRITE_VERSION)

Writes the time zone to the I/O stream in the POSIX tzfile format.

source

Etc.

TimeZones.UTCOffsetType
UTCOffset

A UTCOffset is an amount of time subtracted from or added to UTC to get the current local time – whether it's standard time or daylight saving time.

source
TimeZones.@optionalMacro
@optional(expr)

Creates multiple method signatures to allow optional arguments before required arguments. For example:

f(a=1, b=2, c) = ...

becomes:

f(a, b, c) = ...
 f(a, c) = f(a, 2, c)
-f(c) = f(1, 2, c)
source
TimeZones.parse_tz_formatFunction
parse_tz_format(str) -> TimeZone

Parse the time zone format typically provided via the "TZ" environment variable. Details on the format can be found under the man page for tzset.

source
TimeZones.tryparse_tz_formatFunction
tryparse_tz_format(str) -> Union{TimeZone, Nothing}

Like parse_tz_format, but returns either a value of the TimeZone, or nothing if the string does not contain a valid format.

source
Base.hashMethod
hash(::ZonedDateTime, h)

Compute an integer hash code for a ZonedDateTime by hashing the utc_datetime field. hash(:utc_instant, h) is used to avoid collisions with DateTime hashes.

source
Dates.guessMethod
guess(start::ZonedDateTime, finish::ZonedDateTime, step) -> Integer

Given a start and end date, indicates how many steps/periods are between them. Defining this function allows StepRanges to be defined for ZonedDateTimes.

source
+f(c) = f(1, 2, c)source
TimeZones.parse_tz_formatFunction
parse_tz_format(str) -> TimeZone

Parse the time zone format typically provided via the "TZ" environment variable. Details on the format can be found under the man page for tzset.

source
TimeZones.tryparse_tz_formatFunction
tryparse_tz_format(str) -> Union{TimeZone, Nothing}

Like parse_tz_format, but returns either a value of the TimeZone, or nothing if the string does not contain a valid format.

source
Base.hashMethod
hash(::ZonedDateTime, h)

Compute an integer hash code for a ZonedDateTime by hashing the utc_datetime field. hash(:utc_instant, h) is used to avoid collisions with DateTime hashes.

source
Dates.guessMethod
guess(start::ZonedDateTime, finish::ZonedDateTime, step) -> Integer

Given a start and end date, indicates how many steps/periods are between them. Defining this function allows StepRanges to be defined for ZonedDateTimes.

source
diff --git a/dev/api-public/index.html b/dev/api-public/index.html index 887c7913..4255eb95 100644 --- a/dev/api-public/index.html +++ b/dev/api-public/index.html @@ -103,4 +103,4 @@ Local Time Change: 00:00 → 00:00 (Forward) Offset Change: UTC-11/+1 → UTC+13/+1 Transition From: 2011-12-29T23:59:59.999-10:00 -Transition To: 2011-12-31T00:00:00.000+14:00source +Transition To: 2011-12-31T00:00:00.000+14:00source diff --git a/dev/arithmetic/index.html b/dev/arithmetic/index.html index 9e26a46b..9991353d 100644 --- a/dev/arithmetic/index.html +++ b/dev/arithmetic/index.html @@ -52,4 +52,4 @@ 2016-01-01T14:00:00+00:00 2016-01-01T15:00:00+00:00 2016-01-01T16:00:00+00:00 - 2016-01-01T17:00:00+00:00

Note that 2016-01-01T17:00:00 in UTC corresponds to 2016-01-01T18:00:00 in "Europe/Warsaw", which is the requested endpoint of the range.

+ 2016-01-01T17:00:00+00:00

Note that 2016-01-01T17:00:00 in UTC corresponds to 2016-01-01T18:00:00 in "Europe/Warsaw", which is the requested endpoint of the range.

diff --git a/dev/conversions/index.html b/dev/conversions/index.html index efa72d0c..f8598e4a 100644 --- a/dev/conversions/index.html +++ b/dev/conversions/index.html @@ -40,4 +40,4 @@ "20150806+02:00" julia> Dates.format(zdt, "yyyy-mm-dd HH:MM ZZZ") -"2015-08-06 22:25 CEST" +"2015-08-06 22:25 CEST" diff --git a/dev/current/index.html b/dev/current/index.html index 7de376ad..508a56ce 100644 --- a/dev/current/index.html +++ b/dev/current/index.html @@ -1,2 +1,2 @@ -Current Time · TimeZones.jl

Current Time

now / System Time Zone

Julia provides the now() method to retrieve your current system's time as a DateTime. The TimeZones.jl package provides an additional now(::TimeZone) method providing the current time as a ZonedDateTime:

now(tz"Europe/Warsaw")

To get the TimeZone currently specified on you system you can use localzone(). Combining this method with the new now method produces the current system time in the current system's time zone:

now(localzone())

today

Similar to now the TimeZones package also provides a today(::TimeZone) method which allows you to determine the current date as a Date in the specified TimeZone.

julia> a, b = now(tz"Pacific/Midway"), now(tz"Pacific/Apia")(ZonedDateTime(2024, 2, 27, 15, 21, 42, 480, tz"Pacific/Midway"), ZonedDateTime(2024, 2, 28, 16, 21, 42, 480, tz"Pacific/Apia"))
julia> a - b0 milliseconds
julia> today(tz"Pacific/Midway"), today(tz"Pacific/Apia")(Date("2024-02-27"), Date("2024-02-28"))

You should be careful not to use today() when working with ZonedDateTimes as you may end up using the wrong day. For example:

julia> midway, apia = tz"Pacific/Midway", tz"Pacific/Apia"(tz"Pacific/Midway", tz"Pacific/Apia")
julia> ZonedDateTime(today() + Time(11), midway)2024-02-28T11:00:00-11:00
julia> ZonedDateTime(today() + Time(11), apia) # Wrong date; with the current rules apia should be one day ahead of midway2024-02-28T11:00:00+14:00
julia> ZonedDateTime(today(midway) + Time(11), midway)2024-02-27T11:00:00-11:00
julia> ZonedDateTime(today(apia) + Time(11), apia)2024-02-28T11:00:00+14:00

Alternatively, you can use the todayat function which takes care of this for you:

julia> todayat(Time(11), tz"Pacific/Midway")2024-02-27T11:00:00-11:00
julia> todayat(Time(11), tz"Pacific/Apia")2024-02-28T11:00:00+14:00
+Current Time · TimeZones.jl

Current Time

now / System Time Zone

Julia provides the now() method to retrieve your current system's time as a DateTime. The TimeZones.jl package provides an additional now(::TimeZone) method providing the current time as a ZonedDateTime:

now(tz"Europe/Warsaw")

To get the TimeZone currently specified on you system you can use localzone(). Combining this method with the new now method produces the current system time in the current system's time zone:

now(localzone())

today

Similar to now the TimeZones package also provides a today(::TimeZone) method which allows you to determine the current date as a Date in the specified TimeZone.

julia> a, b = now(tz"Pacific/Midway"), now(tz"Pacific/Apia")(ZonedDateTime(2024, 2, 28, 15, 20, 0, 229, tz"Pacific/Midway"), ZonedDateTime(2024, 2, 29, 16, 20, 0, 229, tz"Pacific/Apia"))
julia> a - b0 milliseconds
julia> today(tz"Pacific/Midway"), today(tz"Pacific/Apia")(Date("2024-02-28"), Date("2024-02-29"))

You should be careful not to use today() when working with ZonedDateTimes as you may end up using the wrong day. For example:

julia> midway, apia = tz"Pacific/Midway", tz"Pacific/Apia"(tz"Pacific/Midway", tz"Pacific/Apia")
julia> ZonedDateTime(today() + Time(11), midway)2024-02-29T11:00:00-11:00
julia> ZonedDateTime(today() + Time(11), apia) # Wrong date; with the current rules apia should be one day ahead of midway2024-02-29T11:00:00+14:00
julia> ZonedDateTime(today(midway) + Time(11), midway)2024-02-28T11:00:00-11:00
julia> ZonedDateTime(today(apia) + Time(11), apia)2024-02-29T11:00:00+14:00

Alternatively, you can use the todayat function which takes care of this for you:

julia> todayat(Time(11), tz"Pacific/Midway")2024-02-28T11:00:00-11:00
julia> todayat(Time(11), tz"Pacific/Apia")2024-02-29T11:00:00+14:00
diff --git a/dev/faq/index.html b/dev/faq/index.html index df3e843c..e5d35104 100644 --- a/dev/faq/index.html +++ b/dev/faq/index.html @@ -28,4 +28,4 @@ TimeZones.TZData.compile(max_year=2220) ZonedDateTime(DateTime(2215), TimeZone("Europe/Warsaw")) end -2215-01-01T00:00:00+01:00 +2215-01-01T00:00:00+01:00 diff --git a/dev/index.html b/dev/index.html index 95e9ba25..5ee509d6 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,4 +1,4 @@ Introduction · TimeZones.jl

Time Zones

TimeZones.jl provides access to the IANA time zone database (also referred to as the tz database) to the programming language Julia. This library can handle any time zone in the tz database but some have excluded by default due to them being deemed as historical (such as "Etc/*").

Installation

The TimeZones package extends the Dates module provided by Julia version 0.4. In order to use this package you will need to have Julia 0.4 or higher installed on your system. Details on downloading and installing Julia can be found on the language homepage.

Once Julia is installed you can simply install TimeZones using the package manager. First open a Julia interactive session and run:

julia> using Pkg  # on Julia 0.7+
 
-julia> Pkg.add("TimeZones")

This command will install the latest version of TimeZones, automatically download the latest tz database, and convert the data into an Julia optimized format.

+julia> Pkg.add("TimeZones")

This command will install the latest version of TimeZones, automatically download the latest tz database, and convert the data into an Julia optimized format.

diff --git a/dev/rounding/index.html b/dev/rounding/index.html index 12e8c81f..996be467 100644 --- a/dev/rounding/index.html +++ b/dev/rounding/index.html @@ -25,4 +25,4 @@ 1996-10-26T00:00:00+06:30 julia> round(zdt, Dates.Day) -ERROR: AmbiguousTimeError: Local DateTime 1996-10-26T00:00:00 is ambiguous within Asia/Colombo +ERROR: AmbiguousTimeError: Local DateTime 1996-10-26T00:00:00 is ambiguous within Asia/Colombo diff --git a/dev/search/index.html b/dev/search/index.html index b03c5280..50f79251 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · TimeZones.jl

Loading search...

    +Search · TimeZones.jl

    Loading search...

      diff --git a/dev/types/index.html b/dev/types/index.html index 7fde00c0..1b5ae166 100644 --- a/dev/types/index.html +++ b/dev/types/index.html @@ -46,4 +46,4 @@ FixedTimeZone("-04:30") FixedTimeZone("+12:34:56") FixedTimeZone("FOO", -6 * 3600) # 6 hours in seconds

      Constructing a ZonedDateTime works similarly to VariableTimeZone:

      julia> ZonedDateTime(1960, 1, 1, tz"UTC")
      -1960-01-01T00:00:00+00:00
      +1960-01-01T00:00:00+00:00