Re: Add __toString() to DateInterval

From: Date: Wed, 03 Mar 2021 12:05:20 +0000
Subject: Re: Add __toString() to DateInterval
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-113340@lists.php.net to get a copy of this message
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:

> On Wed, Mar 3, 2021 at 1:07 PM Moritz Friedrich <m@9dev.de> wrote:
>
> > but I’m not too fond of the constant - all other built-in date constants
> > translate to a string of plain format characters, which isn’t possible in
> > this case
>
>
> Adding another format character (similar to %c used by
> DateTimeInterface::format()) would solve that.
>
> --
>   Best regards,
>       Bruce Weirdan                                     mailto:
> weirdan@gmail.com
>


Thread (19 messages)

« previous php.internals (#113340) next »