If it is a NaiveDateTime, then why not use NaiveDateTime.to_iso8601/1?
iex> NaiveDateTime.to_iso8601(~N[2017-03-23 20:58:23.586989])
"2017-03-23T20:58:23.586989"
If it is a NaiveDateTime, then why not use NaiveDateTime.to_iso8601/1?
iex> NaiveDateTime.to_iso8601(~N[2017-03-23 20:58:23.586989])
"2017-03-23T20:58:23.586989"