quinnj / Datetime.jl

A Date and DateTime implementation for Julia; Now deprecated in favor of https://github.com/quinnj/Dates.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Iso8601 format

spmenard opened this issue · comments

Hi,

the format of you datetime is that way "2013-01-01T00:00:00 UTC" and the standard iso8601 is a bit different : 2014-03-18T21:29:15Z or 2014-03-18T21:29:15+00:00, is there a way to modify the toString function ?

Yeah, we should probably change this to the 2014-03-18T21:28:15+00:00 format.

I'm going to leave this as is for now. The Base version now prints as yyyy-mm-ddTHH:MM:SS, but has the more sophisticated Dates.format(t,format_string) function that allows you to achieve custom strings

In  [8]: t = DateTime(2014)

Out [8]: 2014-01-01T00:00:00

In  [9]: Dates.format(t,"yyyy-mm-ddTHH:MM:SSZ")

Out [9]: "2014-01-01T00:00:00Z"

In  [10]: Dates.format(t,"yyyy-mm-ddTHH:MM:SS+00:00")

Out [10]: "2014-01-01T00:00:00+00:00"