我有一个带有 String31 格式的时间列的数据框。如何将此格式转换为日期时间?
我使用日期时间方法,但它引发了错误::
str_1=data_raw.Time[1,:]
DateTime(str_1, "yyyymmdd HHMMSS")
错误:
MethodError: no method matching Int64(::Vector{String31})
Closest candidates are:
(::Type{T})(!Matched::AbstractChar) where T<:Union{Int32, Int64}
@ Base char.jl:51
(::Type{T})(!Matched::AbstractChar) where T<:Union{AbstractChar, Number}
@ Base char.jl:50
(::Type{T})(!Matched::BigInt) where T<:Union{Int128, Int16, Int32, Int64, Int8}
@ Base gmp.jl:36
做:
DateTime.(str_1, "yyyy-mm-dd HH:MM:SS")
(注意
.
之前的 (
- 它会在 DateTime
的所有元素上广播 str_1
)