Re: [PHP-DEV] New constants in DateTime

2017-03-02 Thread Rasmus Schultz
FWIW, these constants are not universal. In Postgres (and MySQL since 5.7) the date+time types have optional sub-second precision - which the "Y-m-d H:i:s" pattern will fail to parse. Another common case in Postgres is date+time with timezone, e.g. used for scheduling/calendar applications etc.

Re: [PHP-DEV] New constants in DateTime

2017-03-02 Thread Crocodile
Well, actually, that's a good reason for not having interval constants in the core. Still think though that SQL formats would be a nice addition ;-) On Thu, Mar 2, 2017 at 4:57 PM Andreas Heigl wrote: > > Am 02.03.17 um 16:46 schrieb Crocodile: > > While I agree with

Re: [PHP-DEV] New constants in DateTime

2017-03-02 Thread Andreas Heigl
Am 02.03.17 um 16:46 schrieb Crocodile: > While I agree with everything you're saying, I also think it could still be > worth it to have those constants in core for the following reasons: > > 1. MINUTE, HOUR and DAY are particularly often used, 99.999% of the time in > a context where it does

Re: [PHP-DEV] New constants in DateTime

2017-03-02 Thread Crocodile
While I agree with everything you're saying, I also think it could still be worth it to have those constants in core for the following reasons: 1. MINUTE, HOUR and DAY are particularly often used, 99.999% of the time in a context where it does not matter if a minute has 60 seconds or not, or if a

Re: [PHP-DEV] New constants in DateTime

2017-03-02 Thread Andreas Heigl
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 =

[PHP-DEV] New constants in DateTime

2017-03-02 Thread 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";