Skip to content

Instantly share code, notes, and snippets.

@oJshua
Created October 20, 2019 05:08
Show Gist options
  • Save oJshua/b2ba85b551b5ac13439ad5f2714ac192 to your computer and use it in GitHub Desktop.
Save oJshua/b2ba85b551b5ac13439ad5f2714ac192 to your computer and use it in GitHub Desktop.
Parse ISO8601 date string with 'Z' for UTC in Julia
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