-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
datesDates, times, and the Dates stdlib moduleDates, times, and the Dates stdlib module
Description
On Julia v0.7 and v0.6, the ISODateTimeFormat doesn't like the trailing "Z".
julia> DateTime("2017-07-17T14:10:36.000", Dates.ISODateTimeFormat)
2017-07-17T14:10:36
julia> DateTime("2017-07-17T14:10:36.000Z", Dates.ISODateTimeFormat)
ERROR: ArgumentError: Invalid DateTime string
Stacktrace:
[1] parse(::Type{DateTime}, ::String, ::DateFormat{Symbol("yyyy-mm-dd\\THH:MM:SS.s"),Tuple{Base.Dates.DatePart{'y'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'m'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'d'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'H'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'M'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'S'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'s'}}}) at ./dates/parse.jl:265
[2] DateTime(::String, ::DateFormat{Symbol("yyyy-mm-dd\\THH:MM:SS.s"),Tuple{Base.Dates.DatePart{'y'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'m'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'d'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'H'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'M'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'S'},Base.Dates.Delim{Char,1},Base.Dates.DatePart{'s'}}}) at ./dates/io.jl:431
I'm not sure whether it's officially a part of the ISO8601 standard to have the trailing "Z" (it looks like it might be, but I'd need to read the standard and you've got to buy a copy :)). But even if it isn't, it would be nice to accept it, since a lot of places use them for time stamps (e.g. YouTube).
StefanKarpinski, samoconnor, JeffreySarnoff, ruffianeo and fonsp
Metadata
Metadata
Assignees
Labels
datesDates, times, and the Dates stdlib moduleDates, times, and the Dates stdlib module