Created
October 20, 2019 05:08
-
-
Save oJshua/b2ba85b551b5ac13439ad5f2714ac192 to your computer and use it in GitHub Desktop.
Parse ISO8601 date string with 'Z' for UTC in Julia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Dates | |
escaped_format = "yyyy-mm-dd\\THH:MM:SS.sss\\Z" | |
Zulu = String | |
Dates.CONVERSION_SPECIFIERS['Z'] = Zulu | |
Dates.CONVERSION_DEFAULTS[Zulu] = "" | |
df = Dates.DateFormat(escaped_format) | |
function convert_date(datestring::String) | |
Dates.parse(DateTime, datestring, df) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment