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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -