From 7558421d417cd902cc3b70556c60af5373923f3b Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:15:12 -0400 Subject: [PATCH 01/23] Update utcoffset.jl --- src/utcoffset.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utcoffset.jl b/src/utcoffset.jl index 7c06c153e..33f91ba3d 100644 --- a/src/utcoffset.jl +++ b/src/utcoffset.jl @@ -9,7 +9,7 @@ import Base.Dates: AbstractTime, Second, value 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. """ -immutable UTCOffset <: AbstractTime +@compat struct UTCOffset <: AbstractTime std::Second # Standard time offset from UTC in seconds dst::Second # Daylight saving time offset in seconds From 5421faf1bb7706f214b1751d6a3b3e1aaf94e00c Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:17:48 -0400 Subject: [PATCH 02/23] Update types.jl --- src/types.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types.jl b/src/types.jl index ef25f472a..1ef6b18d1 100644 --- a/src/types.jl +++ b/src/types.jl @@ -28,7 +28,7 @@ const FIXED_TIME_ZONE_REGEX = r""" A `TimeZone` with a constant offset for all of time. """ -immutable FixedTimeZone <: TimeZone +struct FixedTimeZone <: TimeZone name::Symbol offset::UTCOffset end @@ -101,7 +101,7 @@ Base.isless(x::Transition,y::Transition) = isless(x.utc_datetime,y.utc_datetime) A `TimeZone` with an offset that changes over time. """ -immutable VariableTimeZone <: TimeZone +struct VariableTimeZone <: TimeZone name::Symbol transitions::Vector{Transition} cutoff::Nullable{DateTime} @@ -126,7 +126,7 @@ end # A `DateTime` that includes `TimeZone` information. # """ -immutable ZonedDateTime <: TimeType +struct ZonedDateTime <: TimeType utc_datetime::DateTime timezone::TimeZone zone::FixedTimeZone # The current zone for the utc_datetime. From 409248ffbd2d8bd4f80f5e9241816720b859fe73 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:18:41 -0400 Subject: [PATCH 03/23] immutable --> struct --- src/types.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.jl b/src/types.jl index 1ef6b18d1..cd2d1497c 100644 --- a/src/types.jl +++ b/src/types.jl @@ -89,7 +89,7 @@ function FixedTimeZone(s::AbstractString) return FixedTimeZone(name, offset) end -immutable Transition +struct Transition utc_datetime::DateTime # Instant where new zone applies zone::FixedTimeZone end From 898386fe7656395e8c1171d189354f86e84b9159 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:19:28 -0400 Subject: [PATCH 04/23] immutable --> struct --- src/utcoffset.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utcoffset.jl b/src/utcoffset.jl index 33f91ba3d..e91a80b66 100644 --- a/src/utcoffset.jl +++ b/src/utcoffset.jl @@ -9,7 +9,7 @@ import Base.Dates: AbstractTime, Second, value 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. """ -@compat struct UTCOffset <: AbstractTime +struct UTCOffset <: AbstractTime std::Second # Standard time offset from UTC in seconds dst::Second # Daylight saving time offset in seconds From d5ee5a356ad9af2fc876a0242b496168e62034e0 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:20:33 -0400 Subject: [PATCH 05/23] immutable --> struct --- src/tzdata/timeoffset.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tzdata/timeoffset.jl b/src/tzdata/timeoffset.jl index c2235efe8..19916781a 100644 --- a/src/tzdata/timeoffset.jl +++ b/src/tzdata/timeoffset.jl @@ -3,7 +3,7 @@ import Base.Dates: Period, TimePeriod, Week, Day, Hour, Minute, Second, Millisec value, toms, hour, minute, second # Convenience type for working with HH:MM:SS. -immutable TimeOffset <: TimePeriod +struct TimeOffset <: TimePeriod seconds::Int end const ZERO = TimeOffset(0) From a25512250defef5d44c86bf4d0e664406dc4fc17 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:21:58 -0400 Subject: [PATCH 06/23] type --> mutable struct --- src/exceptions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exceptions.jl b/src/exceptions.jl index 953f31908..75e5b2868 100644 --- a/src/exceptions.jl +++ b/src/exceptions.jl @@ -9,7 +9,7 @@ import Compat: @compat The provided local datetime is ambiguous within the specified timezone. Typically occurs on daylight saving time transitions which "fall back" causing duplicate hour long period. """ -type AmbiguousTimeError <: TimeError +mutable struct AmbiguousTimeError <: TimeError local_dt::DateTime timezone::TimeZone end @@ -26,7 +26,7 @@ The provided local datetime is does not exist within the specified timezone. Typ occurs on daylight saving time transitions which "spring forward" causing an hour long period to be skipped. """ -type NonExistentTimeError <: TimeError +mutable struct NonExistentTimeError <: TimeError local_dt::DateTime timezone::TimeZone end From 2ae2445c1b7277b444fc91cb739cfa52879f6ad6 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:24:47 -0400 Subject: [PATCH 07/23] is_windows --> Sys.iswindows --- src/tzdata/archive.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tzdata/archive.jl b/src/tzdata/archive.jl index 57a46da21..6d5e5f8c8 100644 --- a/src/tzdata/archive.jl +++ b/src/tzdata/archive.jl @@ -1,6 +1,6 @@ -import Compat: @static, is_windows +import Compat: @static -if is_windows() +if Sys.iswindows() const exe7z = joinpath(JULIA_HOME, "7z.exe") end @@ -12,7 +12,7 @@ specified only the files given will be extracted. The `verbose` flag can be used additional information to STDOUT. """ function extract(archive, directory, files=AbstractString[]; verbose::Bool=false) - @static if is_windows() + @static if Sys.iswindows() cmd = pipeline(`$exe7z x $archive -y -so`, `$exe7z x -si -y -ttar -o$directory $files`) else cmd = `tar xvf $archive --directory=$directory $files` @@ -31,7 +31,7 @@ end Determines if the given `path` is an archive. """ function isarchive(path) - @static if is_windows() + @static if Sys.iswindows() success(`$exe7z t $path -y`) else success(`tar tf $path`) @@ -44,7 +44,7 @@ end Returns the file names contained in the `archive`. """ function readarchive(archive) - @static if is_windows() + @static if Sys.iswindows() files = AbstractString[] header = "-" ^ 24 content = false From 5de97dacfc85c57f6d2358ca52fd61c07da567fb Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:27:26 -0400 Subject: [PATCH 08/23] type --> mutable struct --- src/tzdata/compile.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tzdata/compile.jl b/src/tzdata/compile.jl index d8b9b86f3..ff9b85378 100644 --- a/src/tzdata/compile.jl +++ b/src/tzdata/compile.jl @@ -16,7 +16,7 @@ else end # Zone type maps to an Olson Timezone database entity -type Zone +mutable struct Zone gmtoffset::TimeOffset save::TimeOffset rules::AbstractString @@ -39,7 +39,7 @@ function Base.isless(x::Zone,y::Zone) end # Rules govern how Daylight Savings transitions happen for a given time zone -type Rule +mutable struct Rule from::Nullable{Int} # First year rule applies to::Nullable{Int} # Rule applies up until, but not including this year month::Int # Month in which DST transition happens From 6c59bdfa8079dac56a1ded011b18372c50fe7be4 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:28:58 -0400 Subject: [PATCH 09/23] immutable --> struct --- src/tzfile.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tzfile.jl b/src/tzfile.jl index b206e175d..96b7da94e 100644 --- a/src/tzfile.jl +++ b/src/tzfile.jl @@ -6,7 +6,7 @@ import Compat: read, unsafe_string const TZFILE_MAX = unix2datetime(typemax(Int32)) -immutable TransitionTimeInfo +struct TransitionTimeInfo gmtoff::Int32 # tt_gmtoff isdst::Int8 # tt_isdst abbrindex::UInt8 # tt_abbrind From 43239b3631cc90bcdba892e2c80426f256997f27 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:31:28 -0400 Subject: [PATCH 10/23] is_ --> Sys.is --- src/local.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/local.jl b/src/local.jl index c27464798..04ded82e1 100644 --- a/src/local.jl +++ b/src/local.jl @@ -1,9 +1,9 @@ # Determine the local system's time zone # Based upon Python's tzlocal https://pypi.python.org/pypi/tzlocal -import Compat: @static, is_apple, is_unix, is_windows, readstring +import Compat: @static, readstring using Mocking -if is_windows() +if Sys.iswindows() import TimeZones.WindowsTimeZoneIDs: WINDOWS_TRANSLATION end @@ -13,7 +13,7 @@ end Returns a `TimeZone` object that is equivalent to the system's current time zone. """ function localzone() - @static if is_apple() + @static if Sys.isapple() name = @mock readstring(`systemsetup -gettimezone`) # Appears to only work as root if contains(name, "Time Zone: ") name = strip(replace(name, "Time Zone: ", "")) @@ -23,7 +23,7 @@ function localzone() name = match(r"(?<=zoneinfo/).*$", name).match end return TimeZone(name) - elseif is_unix() + elseif Sys.isunix() name = "" validnames = timezone_names() @@ -115,7 +115,7 @@ function localzone() read_tzfile(f, "local") end end - elseif is_windows() + elseif Sys.iswindows() # Windows powershell should be available on Windows 7 and above win_name = strip(@mock readstring(`powershell -Command "[TimeZoneInfo]::Local.Id"`)) From 5e61effe6639e6773c8ead0b25026fbcaaeccc40 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:35:32 -0400 Subject: [PATCH 11/23] --> where syntax --- src/conversions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conversions.jl b/src/conversions.jl index 55a37ac1c..1bde5c53a 100644 --- a/src/conversions.jl +++ b/src/conversions.jl @@ -49,11 +49,11 @@ function zdt2unix(zdt::ZonedDateTime) Dates.datetime2unix(utc(zdt)) end -function zdt2unix{T<:Integer}(::Type{T}, zdt::ZonedDateTime) +function zdt2unix(::Type{T}, zdt::ZonedDateTime) where T<:Integer floor(T, Dates.datetime2unix(utc(zdt))) end -function zdt2unix{T<:Number}(::Type{T}, zdt::ZonedDateTime) +function zdt2unix(::Type{T}, zdt::ZonedDateTime) where T<:Number convert(T, Dates.datetime2unix(utc(zdt))) end From c38957443991d56e0ca2b1350ab6feed8e7e2bff Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:38:41 -0400 Subject: [PATCH 12/23] --> where syntax (I like the extra careful trunc) --- src/adjusters.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/adjusters.jl b/src/adjusters.jl index 0131b6b33..755939f47 100644 --- a/src/adjusters.jl +++ b/src/adjusters.jl @@ -5,10 +5,11 @@ import Base.Dates: firstdayofweek, lastdayofweek, firstdayofmonth, lastdayofmont # Truncation # TODO: Just utilize floor code for truncation? -function trunc{P<:DatePeriod}(zdt::ZonedDateTime, ::Type{P}) + +function trunc(zdt::ZonedDateTime, ::Type{P}) where P<:DatePeriod ZonedDateTime(trunc(localtime(zdt), P), timezone(zdt)) end -function trunc{P<:TimePeriod}(zdt::ZonedDateTime, ::Type{P}) +function trunc(zdt::ZonedDateTime, ::Type{P}) where P<:DatePeriod local_dt = trunc(localtime(zdt), P) utc_dt = local_dt - zdt.zone.offset ZonedDateTime(utc_dt, timezone(zdt); from_utc=true) From d182275af14e325a10c4b7172b8ba36b3992976a Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Thu, 31 Aug 2017 09:41:43 -0400 Subject: [PATCH 13/23] --> where syntax --- src/tzdata/timeoffset.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tzdata/timeoffset.jl b/src/tzdata/timeoffset.jl index 19916781a..91ae1347d 100644 --- a/src/tzdata/timeoffset.jl +++ b/src/tzdata/timeoffset.jl @@ -50,7 +50,9 @@ end convert(::Type{Second}, t::TimeOffset) = Second(value(t)) convert(::Type{Millisecond}, t::TimeOffset) = Millisecond(value(t) * 1000) -promote_rule{P<:Union{Week,Day,Hour,Minute,Second}}(::Type{P}, ::Type{TimeOffset}) = Second + +const WDHMS = Union{Week,Day,Hour,Minute,Second} +promote_rule(::Type{P}, ::Type{TimeOffset}) where P<:WDHMS = Second promote_rule(::Type{Millisecond}, ::Type{TimeOffset}) = Millisecond # https://en.wikipedia.org/wiki/ISO_8601#Times From 8b3b77475ee119622f2c7c9b6d47bd1af112ccd0 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 01:09:33 -0400 Subject: [PATCH 14/23] Sys from Compat --- src/tzdata/archive.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tzdata/archive.jl b/src/tzdata/archive.jl index 6d5e5f8c8..11b7c05ca 100644 --- a/src/tzdata/archive.jl +++ b/src/tzdata/archive.jl @@ -1,4 +1,4 @@ -import Compat: @static +import Compat: @static, Sys if Sys.iswindows() const exe7z = joinpath(JULIA_HOME, "7z.exe") From 139b1f568e5da7c26e2d468fa5d066db46804975 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 01:11:29 -0400 Subject: [PATCH 15/23] remove extra blank line --- src/adjusters.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/adjusters.jl b/src/adjusters.jl index 755939f47..b27e8bbdf 100644 --- a/src/adjusters.jl +++ b/src/adjusters.jl @@ -5,7 +5,6 @@ import Base.Dates: firstdayofweek, lastdayofweek, firstdayofmonth, lastdayofmont # Truncation # TODO: Just utilize floor code for truncation? - function trunc(zdt::ZonedDateTime, ::Type{P}) where P<:DatePeriod ZonedDateTime(trunc(localtime(zdt), P), timezone(zdt)) end From 8313b269c734f6b8627b92c8b870ac4e76534040 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 01:12:44 -0400 Subject: [PATCH 16/23] to julia 0.6, compat 2.7 --- REQUIRE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/REQUIRE b/REQUIRE index 5d4b55e56..6ab2d2aab 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,4 @@ -julia 0.4 -Compat 0.25 +julia 0.6 +Compat 0.27 Mocking 0.2 @windows LightXML 0.2 From e1b4f3aff20b553c0f9e4b5c1d50214d69c6836f Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 01:13:26 -0400 Subject: [PATCH 17/23] for julia v0.6 --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab9bcfa41..1431d0145 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,6 @@ os: - osx - linux julia: - - "0.4" - - "0.5" - "0.6" - nightly notifications: From 440c9ccdcfe569b1592d77a6c5f7accc19ed4730 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 01:16:38 -0400 Subject: [PATCH 18/23] drop v0.4, v0.5 support --- appveyor.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4037d8f45..806f5cf62 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,12 +2,6 @@ environment: JULIA_TZ_VERSION: "2016j" matrix: - - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe" - COVERAGE: "true" - - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe" - COVERAGE: "true" - - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe" - - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe" - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe" COVERAGE: "true" - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe" From a54f4e3883d18b4977b6d58c126df1da96eedfa5 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 08:30:21 -0400 Subject: [PATCH 19/23] import Compat: .., Sys --- src/local.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/local.jl b/src/local.jl index 04ded82e1..500f9786d 100644 --- a/src/local.jl +++ b/src/local.jl @@ -1,9 +1,9 @@ # Determine the local system's time zone # Based upon Python's tzlocal https://pypi.python.org/pypi/tzlocal -import Compat: @static, readstring +import Compat: @static, readstring, Sys using Mocking -if Sys.iswindows() +if Sys.iswindows import TimeZones.WindowsTimeZoneIDs: WINDOWS_TRANSLATION end From 855f2a5c4b309c9c96489a4bf97275e046dd73bb Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 12:28:01 -0400 Subject: [PATCH 20/23] add parens --- src/local.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/local.jl b/src/local.jl index 500f9786d..1d18ed43b 100644 --- a/src/local.jl +++ b/src/local.jl @@ -3,7 +3,7 @@ import Compat: @static, readstring, Sys using Mocking -if Sys.iswindows +if Sys.iswindows() import TimeZones.WindowsTimeZoneIDs: WINDOWS_TRANSLATION end From 81a47fb1dc00b134bf4837eaf0a366f55c53abff Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 16:42:19 -0400 Subject: [PATCH 21/23] repair overwritten --- src/adjusters.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adjusters.jl b/src/adjusters.jl index b27e8bbdf..0131b6b33 100644 --- a/src/adjusters.jl +++ b/src/adjusters.jl @@ -5,10 +5,10 @@ import Base.Dates: firstdayofweek, lastdayofweek, firstdayofmonth, lastdayofmont # Truncation # TODO: Just utilize floor code for truncation? -function trunc(zdt::ZonedDateTime, ::Type{P}) where P<:DatePeriod +function trunc{P<:DatePeriod}(zdt::ZonedDateTime, ::Type{P}) ZonedDateTime(trunc(localtime(zdt), P), timezone(zdt)) end -function trunc(zdt::ZonedDateTime, ::Type{P}) where P<:DatePeriod +function trunc{P<:TimePeriod}(zdt::ZonedDateTime, ::Type{P}) local_dt = trunc(localtime(zdt), P) utc_dt = local_dt - zdt.zone.offset ZonedDateTime(utc_dt, timezone(zdt); from_utc=true) From 0d425c9bcef7871589980e75ba61e8e4778c4680 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 16:53:08 -0400 Subject: [PATCH 22/23] is_linux -> Sys.islinux() with Compat --- test/local.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/local.jl b/test/local.jl index 2178c48ee..300d634e1 100644 --- a/test/local.jl +++ b/test/local.jl @@ -1,12 +1,12 @@ import TimeZones: TimeZone, localzone -import Compat: is_linux +import Compat: Sys # Ensure that the current system's local time zone is supported. If this test fails make # sure to report it as an issue. @test isa(localzone(), TimeZone) -if is_linux() +if Sys.islinux() # Bad TZ environmental variables withenv("TZ" => "") do @test_throws ErrorException localzone() From 31a3cb37796261a15dbf7b87b5ba647469433119 Mon Sep 17 00:00:00 2001 From: Jeffrey Sarnoff Date: Fri, 1 Sep 2017 16:55:39 -0400 Subject: [PATCH 23/23] is_ --> Sys.is with Compat --- test/local_mocking.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/local_mocking.jl b/test/local_mocking.jl index 69067734d..b7b7dac33 100644 --- a/test/local_mocking.jl +++ b/test/local_mocking.jl @@ -1,7 +1,7 @@ import TimeZones: TimeZone, localzone import Mocking: @patch, apply import Base: AbstractCmd -import Compat: is_apple, is_windows, is_linux, readstring +import Compat: Sys, readstring # For mocking make sure we are actually changing the time zone name = string(localzone()) == "Europe/Warsaw" ? "Pacific/Apia" : "Europe/Warsaw" @@ -11,7 +11,7 @@ tzfile_path = joinpath(TZFILE_DIR, split(name, '/')...) win_name = name == "Europe/Warsaw" ? "Central European Standard Time" : "Samoa Standard Time" timezone = TimeZone(name) -if is_apple() +if Sys.isapple() # Determine time zone via systemsetup. patch = @patch readstring(cmd::AbstractCmd) = "Time Zone: " * name * "\n" apply(patch) do @@ -27,7 +27,7 @@ if is_apple() @test localzone() == timezone end -elseif is_windows() +elseif Sys.iswindows() patch = @patch readstring(cmd::AbstractCmd) = "$win_name\r\n" apply(patch) do @test localzone() == timezone @@ -35,7 +35,7 @@ elseif is_windows() # Dateline Standard Time -> Etc/GMT+12 -> UTC-12:00 -elseif is_linux() +elseif Sys.islinux() # Test TZ environmental variable withenv("TZ" => ":$name") do @test localzone() == timezone