Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert datetime to RFC 3339

Tags:

php

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?

like image 552
Sadikhasan Avatar asked Mar 10 '14 09:03

Sadikhasan


People also ask

What is the rfc-3339 date-time format?

The RFC-3339 date-time format is used in a number of specifications such as the Atom Syndication Format. Show activity on this post. You don't need to write your own conversion code.

What is 3339 date and time on the Internet?

RFC 3339 Date and Time on the Internet: Timestamps July 2002 Appendix A. ISO 8601 Collected ABNF This information is based on the 1988 version of ISO 8601. There may be some changes in the 2000 revision. ISO 8601 does not specify a formal grammar for the date and time formats it defines.

What is the difference between RFC 3339 and ISO 8601?

It’s ISO 8601 standard for Datetime. And for people that already familiar with ISO 8601, the RFC 3339 is pretty similar. What’s different? So, if you look again at the RFC document. RFC 3339 use/follow the ISO 8601 profile for the Internet DateTime.

What is the IMail-update date/time format?

Email Date/Time Format The date/time format used by Internet Mail as defined by RFC 2822 [ IMAIL-UPDATE ]. Internet Date/Time Format The date format defined in section 5 of this document. Timestamp This term is used in this document to refer to an unambiguous representation of some instant in time.


1 Answers

here another option added in php5 like this

$datetime= date("c", strtotime("2014-03-10 05:40:00"));
echo $datetime;  //Output : 2014-03-10T05:40:00+00:00 
like image 86
Sadikhasan Avatar answered Oct 05 '22 11:10

Sadikhasan