I need to SELECT a ISO 8601 Date.
DATE_FORMAT(date, '%Y-%m-%dT%TZ')
This produces something like
2013-11-13T15:47:530Z
But I need it with the offset instead of Z value:
2013-11-13T15:47:53+02:00
How can I do this with plain MySQL ?
I need to SELECT a ISO 8601 Date.
DATE_FORMAT(date, '%Y-%m-%dT%TZ')
This produces something like
2013-11-13T15:47:530Z
But I need it with the offset instead of Z value:
2013-11-13T15:47:53+02:00
How can I do this with plain MySQL ?
his snippet should work for iso 8601 without milis, zulu time is also not supported:
You need to store the timezone as an extra column in DB. I do not know any DB that stores datetime with timezone/offset.
Or store the date as string in ISO 8601 format with offset..
Edit: I stand somewhat corrected, with some newer databases it is possible!
Seems to actually be somewhat standard SQL99.
Not for Mysql. Version 5.6.
I do find consolation in the fact that the correction came from myself ;-)