I want to convert dates in following format using php...
2014-12-09T18:30:00.000Z
What do we call this type of time format?
How to format any date to this format?
Please suggest, thanks
I want to convert dates in following format using php...
2014-12-09T18:30:00.000Z
What do we call this type of time format?
How to format any date to this format?
Please suggest, thanks
I think this is what you want :
$date->format('Y-m-d\TH:i:s\Z');
EDIT :
Time Zones
To specify a time zone, you can either enter a date in UTC time by adding a "Z" behind the date - like this:
2002-09-24Z
DateTime Data Type
The dateTime data type is used to specify a date and a time.
The dateTime is specified in the following form "YYYY-MM-DDThh:mm:ss" where:
YYYY indicates the year
MM indicates the month
DD indicates the day
T indicates the start of the required time section
hh indicates the hour
mm indicates the minute
ss indicates the second