Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upParsing ISO 8601 compatible standard timestamp format (yyyy-mm-ddThh:mm:ss+-ZONE) #37
Comments
|
There is a function R> anytime:::testFormat("%Y-%m-%dT%H:%M:%S%z", "2016-12-13T17:09:48+01:00")
[1] "2016-12-13 17:09:48 CST"
R> anytime:::testFormat("%Y-%m-%dT%H:%M:%S%z", "2016-12-13T17:09:48-03:00")
[1] "2016-12-13 17:09:48 CST"
R> As you can see, the date is parsed (good, and better than what we have now) but the actual tz argument is always ignored -- and that is documented -- which is bad. But yes, ISO is good. I will add some variants. Luckily this seems tolerant to with/without |
|
Ok, I just added it, with this test block: cat("\n") # ISO 8601 variants, note that TZ field is always ignored, see Boost documentation
anytime(c("2016-09-01T10:11:12-05:00", "2016-09-01T10:11:12.345678-05:00"))
anytime(c("2016-09-01T10:11:12-0500", "2016-09-01T10:11:12.345678-0500"))
anytime(c("2016-09-01T10:11:12 CDT", "2016-09-01T10:11:12.345678 CDT"))The wierd thing is that the ones on the right were already being parsed in the just-release 0.1.2. Now we also get the ones on the left which is good. |
|
Thank you very much! Works great in version 0.2.0. |
Is there any possibility to support ISO 8601 compatible standard timestamp format (yyyy-mm-ddThh:mm:ss+-ZONE) with timezone offset?
Thanks,
Dusan