Re: New constants in DateTime
| From: | Andreas Heigl | Date: | Thu, 02 Mar 2017 15:03:33 +0000 |
| Subject: | Re: New constants in DateTime | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98379@lists.php.net to get a copy of this message | ||
Hi Victor.
Am 02.03.17 um 15:48 schrieb Crocodile:
> Hello internals,
>
> A similar question should have been asked already but I haven't found
> anything so far when googling: I think DateTime class should have the
> following constants in addition to those already existing:
>
> const SQL = "Y-m-d H:i:s";
> const SQL_DATE = "Y-m-d";
> const SQL_TIME = "H:i:s";
> const SECOND = 1;
> const MINUTE = 60;
Not every minute has 60 seconds.
> const HOUR = 3600;
See above!
> const DAY = 86400;
Not every day has 86400 seconds. For one see the comment on MINUTE and
also there are days that have more or less than 24 hours (DST)
Therefore I wouldn't want to see those constants (that are also very
easy to put up in userland - even though they aren't correct) in the
PHP-Core.
And as the SQL-Constants are also easily to implement in userland I'm
not sure it makes to add them to the core…
But that's just my 0.02€
Cheers
Andreas
--
,,,
(o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl |
| mailto:andreas@heigl.org N
50°22'59.5" E 08°23'58" |
| http://andreas.heigl.org http://hei.gl/wiFKy7 |
+---------------------------------------------------------------------+
| http://hei.gl/root-ca
|
+---------------------------------------------------------------------+
Attachment: [application/pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
Attachment: [application/pkcs7-signature] S/MIME Cryptographic Signature smime.p7s