Skip to content

Commit

Permalink
Split time zone info if it is given
Browse files Browse the repository at this point in the history
  • Loading branch information
meggart committed Feb 14, 2020
1 parent 440b432 commit 4a0256e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/CFTime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,14 @@ function parseDT(::Type{DT},str) where DT <: Union{DateTime,AbstractCFDateTime}
(y,m,d,h,mi,s,Int64(0))
=#
timestr,tz = if occursin("+",timestr)
ts,tz = split(timestr,"+")
ts,tz
else
timestr, "00:00"
end

time_split = split(timestr,':')

h_str, mi_str, s_str =
if length(time_split) == 2
time_split[1], time_split[2], "00"
Expand All @@ -516,7 +521,6 @@ function parseDT(::Type{DT},str) where DT <: Union{DateTime,AbstractCFDateTime}

h = parse(Int64,h_str)
mi = parse(Int64,mi_str)

s,ms =
if occursin('.',s_str)
# seconds contain a decimal point, e.g. 00:00:00.0
Expand Down

0 comments on commit 4a0256e

Please sign in to comment.