M
M
Michael2018-03-19 17:01:45
PHP
Michael, 2018-03-19 17:01:45

Does PHP have a default date format?

Inside php there is a date interface:

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

    // ...
}

However, the most common Ymd H:i:s format is not in it. Therefore, I think to create a class with the format constant I need, inherited from DateTime. But I can’t understand everything, didn’t they make the default format in php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2018-03-19
@springimport

ISO8601
https://ru.wikipedia.org/wiki/ISO_8601

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question