What is the format of this hour?

Asked

Viewed 159 times

-4

What is the date and time format in PHP 7.2?

2019-05-13T10:00:00.000Z

For example, the time date 2019-01-01 10:00:00 has the format Y-m-d H:i:s.

  • 2

    Please do not pollute the community with repeated questions. If you have asked, be patient that sooner or later someone will answer. If in two days no one answers, there is the option of reward by the answer. If you are in a hurry to solve the problem, maybe the site is not the best place.

1 answer

0

Well the question was confused, if you wanted to format this date use the question already answered: Formatting Date, Time and Time in PHP.

But if you would like to know the format of this date, you could take a look at the PHP 7 documentation on DateTime.

DateTime implements DateTimeInterface {

       const string DateTimeInterface::ATOM = "Y-m-d\TH:i:sP" ;
       const string DateTimeInterface::COOKIE = "l, d-M-Y H:i:s T" ;
       const string DateTimeInterface::ISO8601 = "Y-m-d\TH:i:sO" ;
       const string DateTimeInterface::RFC822 = "D, d M y H:i:s O" ;
       const string DateTimeInterface::RFC850 = "l, d-M-y H:i:s T" ;
       const string DateTimeInterface::RFC1036 = "D, d M y H:i:s O" ;
       const string DateTimeInterface::RFC1123 = "D, d M Y H:i:s O" ;
       const string DateTimeInterface::RFC2822 = "D, d M Y H:i:s O" ;
       const string DateTimeInterface::RFC3339 = "Y-m-d\TH:i:sP" ;
       const string DateTimeInterface::RFC3339_EXTENDED = "Y-m-d\TH:i:s.vP" ;
       const string DateTimeInterface::RSS = "D, d M Y H:i:s O" ;
       const string DateTimeInterface::W3C = "Y-m-d\TH:i:sP" ;

The above section refers to class DateTime, for more details see the following topics.

Maybe yours is one of those: DATE_ATOM | DATE_ISO8601 | DATE_RFC3339_EXTENDED | DATE_W3C, but I’m not sure, anyway I hope to have helped :).

  • That format (2019-05-13T10:00:00.000Z) is defined by ISO 8601 standard. Only that the constant DateTime::ISO8601 does not consider the fraction of a second. The closest to the format in question is DATE_RFC3339_EXTENDED, but I don’t know why it doesn’t work, see here. One way to resolve this is what I suggested in https://answall.com/a/356609/112052

Browser other questions tagged

You are not signed in. Login or sign up in order to post.