Re: RFC for Adding __toString to DateTime
| From: | Lars Strojny | Date: | Mon, 03 Sep 2012 12:11:06 +0000 |
| Subject: | Re: RFC for Adding __toString to DateTime | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62732@lists.php.net to get a copy of this message | ||
Hi Will,
Am 03.09.2012 um 14:01 schrieb Will Fitch <wfitch@meetme.com>:
> On Mon, Sep 3, 2012 at 7:57 AM, Pierre Joye <pierre.php@gmail.com> wrote:
[...]
> I actually feel a static function which tracks globally would best serve
> this case:
>
> date_default_format_set('c')
>
> This would prevent the need for setting it on a per instance basis -
> similar to the way timezones can be set:
>
> date_default_timezone_set('America/Chicago')
Please let’s not add another global setting. DateTime objects are basically value objects. If you
need to create specific flavors of them, use a Factory.
Otherwise we will end up with horrible incompatibilities between libraries depending on different
formats.
cu,
Lars