My input date is 2014-03-10 05:40:00. How can I convert it to RFC format like 2014-3-10T05:40:00.000-00:00?
2014-03-10 05:40:00
2014-3-10T05:40:00.000-00:00
I'd like to add that the predefined constants for this can also be used with date(). Both:
date()
date(DATE_RFC3339);
and
date(DATE_ATOM);
return an RFC3339 formatted date time string and are the equivalent of:
date('Y-m-d\TH:i:sP');