You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Julia 0.5 had a Dates.parse function which could parse a string into an Array{Period}. The function was useful for parsing DateTimes which needed modification before constructing a DateTime object.
For example on Julia 0.5:
julia> df = Dates.DateFormat("yyyy-mm-dd HH:MM");
julia>DateTime("2016-03-03 24:00", df)
ERROR: ArgumentError: Hour:24 out of range (0:23)
inDateTime(::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64) at ./dates/types.jl:149inDateTime(::Base.Dates.Year, ::Base.Dates.Month, ::Base.Dates.Day, ::Base.Dates.Hour, ::Base.Dates.Minute) at ./dates/types.jl:172inDateTime(::String, ::Base.Dates.DateFormat) at ./dates/io.jl:268
julia> Dates.parse("2016-03-03 24:00", df)
5-element Array{Base.Dates.Period,1}:2016 years
3 months
3 days
24 hours
0 minutes
In Julia 0.6
julia> Dates.parse("2016-03-03 24:00", Dates.DateFormat("yyyy-mm-dd HH:MM"))
ERROR: MethodError: no method matching parse(::String, ::DateFormat{Symbol("yyyy-mm-dd HH:MM"),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'}}})
Closest candidates are:parse(::AbstractString, ::Int64; greedy, raise) at parse.jl:215parse(::AbstractString; raise) at parse.jl:230
The text was updated successfully, but these errors were encountered:
@shashi, can we add that feature back within the new fast parsing framework? Otherwise it should technically be deprecated, but it seems like making it work would be even better as it's useful.
Julia 0.5 had a
Dates.parse
function which could parse a string into anArray{Period}
. The function was useful for parsingDateTime
s which needed modification before constructing aDateTime
object.For example on Julia 0.5:
In Julia 0.6
The text was updated successfully, but these errors were encountered: