How's this?

julia>  v1 = ["96/15/03", "15/15/03"]
2-element Array{ASCIIString,1}:
 "96/15/03"
 "15/15/03"

julia> dt = DateTime(v1,"yy/dd/mm")
2-element Array{DateTime,1}:
 0096-03-15T00:00:00
 0015-03-15T00:00:00

julia> [Dates.year(d) > 16 ? d+Dates.Year(1900) : d+Dates.Year(2000) for d 
in dt]
2-element Array{Any,1}:
 1996-03-15T00:00:00
 2015-03-15T00:00:00


On Tuesday, June 14, 2016 at 3:00:01 PM UTC+8, akrun wrote:
>
> Hi,
>
> If I have a vector of dates
>
>    v1 = ["96/15/03", "15/15/03"]
>
> Using DateTime, it gives
>
>     DateTime(v1, "yy/dd/mm")
>     #2-element Array{DateTime,1}:
>     #0096-03-15T00:00:00
>     #0015-03-15T00:00:00
>
> How do I get
>
>      1996-03-15T00:00:00 and 2015-03-15T00:00:00
>
> Thanks
>

Reply via email to