I have a Date object, like so:
2017-06-08 08:36:16 +0000
I need to convert this to a string, in this form:
"2017-06-08T08:36:16Z"
The REST api I am posting to only accepts dates as strings.
Most info I find online is about converting dates to human readable formats. If possible, I could probably even just "stringify" my date object, however trying to cast it as such obviously fails. There are tons of "convert date to string" questions out there, but haven't ran across any like this yet.
Any idea how to do this?