Sto tentando di analizzare un elenco di date di registro su DateTime
istanze, ma genera errori inesatti. Cosa sto sbagliando e come dovrei farlo nel modo giusto?Parsing date Zulu in Julia genera InexactError
julia> using Base.DateTime
julia> readdlm("push-log.txt")[:,1]
16-element Array{Any,1}:
"2016-06-22T14:04:09.9896422Z"
"2016-06-22T14:04:10.0052910Z"
"2016-06-22T14:04:11.3177753Z"
"2016-06-22T14:04:12.3334265Z"
"2016-06-22T14:04:13.4896544Z"
"2016-06-22T14:04:14.1459007Z"
"2016-06-22T14:04:14.6459071Z"
"2016-06-22T14:04:15.6615276Z"
"2016-06-22T14:04:16.2084073Z"
"2016-06-22T14:04:17.2865371Z"
"2016-06-22T14:04:18.3490382Z"
"2016-06-22T14:04:19.2396584Z"
"2016-06-22T14:04:19.7709572Z"
"2016-06-22T14:04:20.9584180Z"
"2016-06-22T14:04:22.0209160Z"
"2016-06-22T14:04:22.6615594Z"
julia> map(readdlm("push-log.txt")[:,1]) do str
DateTime(str, "y-m-dTH:M:S.sZ")
end
ERROR: InexactError()
in slotparse at dates/io.jl:131
in getslot at dates/io.jl:143
in parse at dates/io.jl:158
in anonymous at none:2
in map at essentials.jl:153
julia> versioninfo()
Julia Version 0.4.6
Commit 2e358ce (2016-06-19 17:16 UTC)
Platform Info:
System: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.3
Grazie - che spiega il motivo per cui * * questo accade. Qual è il modo migliore di analizzare il mio file di registro, quindi? –
Arrotondamento [sta arrivando] (https://github.com/JuliaLang/julia/pull/17037). – daycaster
@daycaster fantastico, buono a sapersi! – Chris