php - convert date to T Z format -
this question has answer here:
my date format this
2013-05-07 18:56:57 (yyyy-mm-dd hh:mm:ss)
i want output following.
2013-05-07t06:17:55.827z
is there simple way using big functions ?
this should give proper iso8601 date/time in z(ulu) timezone:
str_replace('+00:00', 'z', gmdate('c'))
to date conversion:
str_replace('+00:00', 'z', gmdate('c', strtotime('2013-05-07 18:56:57')))
to have additional .000
(which useless imho):
str_replace('+00:00', '.000z', gmdate('c', strtotime('2013-05-07 18:56:57')))
Comments
Post a Comment