Le jeudi 26 mai 2016 à 06:15 -0700, akrun a écrit :
> I am using the DataFrames package. I find it difficult to convert to
> DateTime.
>
> println(DateTime("4/5/2002 04:20", "m/d/y H:M"))
> gives output
>
> 2002-04-05T04:20:00
>
> However, if I try
>
> df1 = DataFrame(V1 = ["4/5/2002 04:20", "4/5/2002 04:25"])
> println(DateTime(df1[:V1]))
> gives
>
> ArgumentError: Delimiter mismatch. Couldn't find first
> delimiter, "-", in date string
> in parse at dates/io.jl:152
>
>
> Is there any workaround?
This isn't specific to data frames. You also get this with
V1 = ["4/5/2002 04:20", "4/5/2002 04:25"]
DateTime(V1)
Anyway, you need to pass the format as in your first example:
DateTime(V1, "m/d/y H:M")DateTime(df1[:V1], "m/d/y H:M")
Regards