Re: Add __toString() to DateInterval

From: Date: Wed, 03 Mar 2021 12:44:04 +0000
Subject: Re: Add __toString() to DateInterval
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-113341@lists.php.net to get a copy of this message
Le 03/03/2021 à 13:05, Hans Henrik Bergan a écrit :
if FWIW if DateTime::__toString() was just function __toString():string{
     return $this->format(\DateTime::RFC3339);
} i certainly wouldn't complain. On Wed, 3 Mar 2021 at 12:16, Bruce Weirdan <weirdan@gmail.com> wrote:
Considering the replies, PHP Date(Time|Interval) API could probably born again from a nice cleanup/improvements iteration. The one thing I miss the most is not having a Date (especially for when you fetch dates from SQL, and you don't care about TZ handling, you may very bad surprises using a DateTime to reprensent it on the PHP side due to potential implicit TZ conversion, which may create +1 or -1 decal in your dates, either at instance creation or display), along with a Time type, and DateTime being an aggregate of the two altogether. -- Pierre

Thread (19 messages)

« previous php.internals (#113341) next »