Re: [PHP-DEV] DateTime::__set_state() argument changing?

2018-03-10 Thread Antonio Carlos Ribeiro
I get it now, Gabriel, thanks for the clarification. Cheers! Antonio Carlos Ribeiro a...@antoniocarlosribeiro.com (+55) 21-9-8088-2233 (celular TIM) (+55) 21-2556-3164 (fixo residencial) skype: antoniocarlosribeiro ___ *I must say I find television very educational. The minute so

Re: [PHP-DEV] DateTime::__set_state() argument changing?

2018-03-09 Thread Gabriel Caruso
Hello Antonio. Please see https://github.com/php/php-src/pull/3038 for more information. Also, use the https://bugs.php.net if you judge this is a bug. Thanks Em sex, 9 de mar de 2018 às 13:15, Antonio Carlos Ribeiro < a...@antoniocarlosribeiro.com> escreveu: > Due to a recent change in the Car

[PHP-DEV] DateTime::__set_state() argument changing?

2018-03-09 Thread Antonio Carlos Ribeiro
Due to a recent change in the Carbon PHP library, I'm now getting this error, only when testing on PHP Nightly: *Declaration of Carbon\Carbon::__set_state(array $state) should be compatible with DateTime::__set_state($array)* Is the argument type hinting being removed on PHP 7.3? You can see th

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Lester Caine
On 08/11/16 12:46, Derick Rethans wrote: >> Support for microseconds was added late in the 7.1 RC cycle, however is has >> > some issues: > Some *additional* support for microseconds was added in the PHP 7.1 > cycle, mostly to support bug fixes that have been around for a long > time. We had a s

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Arjen Schol
On 11/08/2016 01:46 PM, Derick Rethans wrote: On Tue, 8 Nov 2016, Arjen Schol wrote: Hi, Support for microseconds was added late in the 7.1 RC cycle, however is has some issues: Some *additional* support for microseconds was added in the PHP 7.1 cycle, mostly to support bug fixes that have b

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Arjen Schol
On 11/08/2016 02:49 PM, Derick Rethans wrote: Hi, On Tue, 8 Nov 2016, Arjen Schol wrote: I think you make some bad assumptions here. Please don't top-reply on this list. The examples provided by Sjon are scripts submitted to 3v4l.org They may have bad assumptions, but are real life example

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Davey Shafik
On Tue, Nov 8, 2016 at 6:28 AM, Alice Wonder wrote: > On 11/08/2016 04:16 AM, Arjen Schol wrote: > >> Hi Dan, >> >> I think you make some bad assumptions here. The examples provided by >> Sjon are scripts submitted to 3v4l.org They may have bad assumptions, >> but are real life examples of DateTi

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Alice Wonder
On 11/08/2016 04:16 AM, Arjen Schol wrote: Hi Dan, I think you make some bad assumptions here. The examples provided by Sjon are scripts submitted to 3v4l.org They may have bad assumptions, but are real life examples of DateTime usage. And they will break. They are already broken. That's the p

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Derick Rethans
Hi, On Tue, 8 Nov 2016, Arjen Schol wrote: > I think you make some bad assumptions here. Please don't top-reply on this list. > The examples provided by Sjon are > scripts submitted to 3v4l.org They may have bad assumptions, but are real life > examples of DateTime usage. And they will break.

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Derick Rethans
On Tue, 8 Nov 2016, Arjen Schol wrote: > Hi, > > Support for microseconds was added late in the 7.1 RC cycle, however is has > some issues: Some *additional* support for microseconds was added in the PHP 7.1 cycle, mostly to support bug fixes that have been around for a long time. > > 1. The

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Arjen Schol
Hi Nikita, The https://3v4l.org/YUhFF example was to demonstrate it is NOT easy to set microseconds to zero. NOT to demonstrate new DateTime("5 minutes ago") == new DateTime("5 minutes ago"). new DateTime("5 minutes ago, 0 microseconds") indeed sets the microseconds to zero (nice to know) bu

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Nikita Nefedov
Hey Arjen, On 8 November 2016 at 09:32, Arjen Schol wrote: There is no easy way to set microseconds to 0, you have to call setTime There actually is an easy way, you can pass microseconds absolute value in the constructor as well, it would like: `new DateTime("5 minutes ago, 0 microseconds"

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Arjen Schol
Hi Dan, I think you make some bad assumptions here. The examples provided by Sjon are scripts submitted to 3v4l.org They may have bad assumptions, but are real life examples of DateTime usage. And they will break. We have two issues in our codebase. We ARE testing RC release, I think feedbac

Re: [PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Dan Ackroyd
On 8 November 2016 at 09:32, Arjen Schol wrote: > Hi, > > Support for microseconds was added late in the 7.1 RC cycle, however is has > some issues: My understanding is that if this affects your code, then your code already has a bad assumption in it. The code is mistakenly assuming that two Dat

[PHP-DEV] DateTime microseconds discussion

2016-11-08 Thread Arjen Schol
Hi, Support for microseconds was added late in the 7.1 RC cycle, however is has some issues: 1. There is no easy way to set microseconds to 0, you have to call setTime see https://3v4l.org/YUhFF A setMicroseconds method would be handy and/or support to relative strings to set microseconds to

Re: [PHP-DEV] DateTime / Timezone funny behaviour, between different version

2015-11-17 Thread Martin Keckeis
Hello, 2015-11-17 12:23 GMT+01:00 Derick Rethans : > On Tue, 17 Nov 2015, Martin Keckeis wrote: > > > Hello together, > > > > i just noticed that the date + timezone switching changed a lot last > time? > > > > tl;dr https://3v4l.org/pSplY > > > > When taking a old datetime: > > $date = \DateTime

Re: [PHP-DEV] DateTime / Timezone funny behaviour, between different version

2015-11-17 Thread Derick Rethans
On Tue, 17 Nov 2015, Martin Keckeis wrote: > Hello together, > > i just noticed that the date + timezone switching changed a lot last time? > > tl;dr https://3v4l.org/pSplY > > When taking a old datetime: > $date = \DateTime::createFromFormat('d.m.Y H:i:s', '01.01.1900 00:00:00', > new \DateTim

[PHP-DEV] DateTime / Timezone funny behaviour, between different version

2015-11-17 Thread Martin Keckeis
Hello together, i just noticed that the date + timezone switching changed a lot last time? tl;dr https://3v4l.org/pSplY When taking a old datetime: $date = \DateTime::createFromFormat('d.m.Y H:i:s', '01.01.1900 00:00:00', new \DateTimeZone('Europe/Berlin')); and switching between the given time

Re: [PHP-DEV] DateTime fixes and 5.4 release plan

2013-05-28 Thread Ferenc Kovacs
> > it seems that it will miss even 5.5 final :( > > I've worked quite a bit on this and I'm close to finishing. Really need > just one more transatlantic flight :-) I'll push my changes to a branch. > I think the RFC gets something wrong though. I'll check and report back > > Derick > \o/ -- Fe

Re: [PHP-DEV] DateTime fixes and 5.4 release plan

2013-05-28 Thread Derick Rethans
Ferenc Kovacs wrote: > On Thu, Dec 29, 2011 at 11:51 PM, Daniel Convissor < > dani...@analysisandsolutions.com> wrote: > > > Hi Folks: > > > > David mentioned the following in the git migration email: > > > > >Expect the php-src migration in 14-21 days after 5.4 final. > > > > Can 5.4 final

Re: [PHP-DEV] DateTime fixes and 5.4 release plan

2013-05-27 Thread Ferenc Kovacs
On Thu, Dec 29, 2011 at 11:51 PM, Daniel Convissor < dani...@analysisandsolutions.com> wrote: > Hi Folks: > > David mentioned the following in the git migration email: > > >Expect the php-src migration in 14-21 days after 5.4 final. > > Can 5.4 final please be held off until the DateTime fixes

[PHP-DEV] DateTime for #53437 5.3/5.4

2013-04-09 Thread Anatol Belski
Hi, I just wanted to address again these two patches to be applied in 5.3/5.4 http://git.php.net/?p=php-src.git;a=commitdiff;h=0ee71557ffd285552659b6aa37ea236e3bad493f http://git.php.net/?p=php-src.git;a=commitdiff;h=fa3fc711d3fb54bf1746138ffcf7f46426921204 Both are in 5.5 already for some weeks

FW: [PHP-DEV] DateTime->modify('tomorrow') Bug in PHP 5.3 on Linux

2013-03-13 Thread Christian Stoller
Hi Derick. > The 5.3.14 result is correct. It was apparently a bug in earlier 5.3 > versions. > > cheers, > Derick Thanks for this hint. So I guess that Debian has not ported the bugfix. Do you know the Git Revision of the patch? I would like to inform the PHP maintainers of Debian so that the

Re: [PHP-DEV] DateTime->modify('tomorrow') Bug in PHP 5.3 on Linux

2013-03-12 Thread Ángel González
On 12/03/13 17:30, Derick Rethans wrote: > On Tue, 12 Mar 2013, Jonathan Sundquist wrote: >> Why would the result not preserve the time? > Because "tomorrow" starts at midnight. You want "+1 day". > > cheers, > Derick Alternatively, $d->add(new DateInterval('P1D')); -- PHP Internals - PHP Runtim

Re: [PHP-DEV] DateTime->modify('tomorrow') Bug in PHP 5.3 on Linux

2013-03-12 Thread Derick Rethans
No top posting please! On Tue, 12 Mar 2013, Jonathan Sundquist wrote: > > On Tue, Mar 12, 2013 at 11:04 AM, Derick Rethans wrote: > > > > Current output on Windows with PHP 5.3.14: > > > 2013-02-05 06:33:33 > > > 2013-02-06 00:00:00 > > > > > > Current output on Linux (Debian) with PHP 5.3.3-7

Re: [PHP-DEV] DateTime->modify('tomorrow') Bug in PHP 5.3 on Linux

2013-03-12 Thread Jonathan Sundquist
Why would the result not preserve the time? On Tue, Mar 12, 2013 at 11:04 AM, Derick Rethans wrote: > On Tue, 12 Mar 2013, Christian Stoller wrote: > > > I have a strange bug with DateTime->modify('tomorrow') in PHP 5.3 on > Linux. > > Code to reproduce: > > > > > $d = new DateTime('2013-02-05

Re: [PHP-DEV] DateTime->modify('tomorrow') Bug in PHP 5.3 on Linux

2013-03-12 Thread Derick Rethans
On Tue, 12 Mar 2013, Christian Stoller wrote: > I have a strange bug with DateTime->modify('tomorrow') in PHP 5.3 on Linux. > Code to reproduce: > > $d = new DateTime('2013-02-05 06:33:33'); > echo $d->format('Y-m-d H:i:s')."\n"; > > $d->modify('tomorrow'); > echo $d->format('Y-m-d H:i:s')."\n"

[PHP-DEV] DateTime->modify('tomorrow') Bug in PHP 5.3 on Linux

2013-03-12 Thread Christian Stoller
Dear internals, I have a strange bug with DateTime->modify('tomorrow') in PHP 5.3 on Linux. Code to reproduce: format('Y-m-d H:i:s')."\n"; $d->modify('tomorrow'); echo $d->format('Y-m-d H:i:s')."\n"; ?> Current output on Windows with PHP 5.3.14: 2013-02-05 06:33:33 2013-02-06 00:00:00 Current

Re: [PHP-DEV] DateTime improvement

2012-12-26 Thread Derick Rethans
Stas Malyshev wrote: > > Sebastian had responded off-list that he'd rather have DateTime > inherit > > from DateTimeImmutable, instead of the current variant where > > DateTimeImmutable inherits DateTime. While this OO-design principle > wise > > makes perfect sense, practically it is not as h

Re: [PHP-DEV] DateTime improvement

2012-12-25 Thread Stas Malyshev
Hi! > Sebastian had responded off-list that he'd rather have DateTime inherit > from DateTimeImmutable, instead of the current variant where > DateTimeImmutable inherits DateTime. While this OO-design principle wise > makes perfect sense, practically it is not as handy. I've played with a Act

Re: [PHP-DEV] DateTime improvement

2012-12-24 Thread Derick Rethans
On Tue, 18 Dec 2012, Adam Harvey wrote: > On 18 December 2012 04:52, Lars Strojny wrote: > > I would go with DateTimeValue or DateTimeImmutable as well. > > +1. I'd prefer DateTimeImmutable personally because it describes what > it is better than the other options. That's what I have changed it

Re: [PHP-DEV] DateTime improvement

2012-12-21 Thread Nikita Nefedov
bject: Re: [PHP-DEV] DateTime improvement On 20 December 2012 20:06, Lazare Inepologlou wrote: Of course, I have no idea if anyone in userspace is using DateTimeImmutable... Well, it seems unlikely, unless he is Yoda or French. I mean, in English, it is common to put the adjective in front o

Re: [PHP-DEV] DateTime improvement

2012-12-21 Thread Derick Rethans
On Thu, 20 Dec 2012, Larry Garfield wrote: > I've seen DateTimeValue used elsewhere for userspace immutable date > time objects. Whether that indicates we SHOULD or SHOULD NOT use that > for an in-C version, I don't know. (I'm inclined to say > should-but-namespace, but I don't know if we're

RE: [PHP-DEV] DateTime improvement

2012-12-21 Thread Christian Stoller
namespace, too. Are there any plans to do that? Christian Stoller -Original Message- From: Peter Cowburn [mailto:petercowb...@gmail.com] Sent: Friday, December 21, 2012 1:14 AM To: Lazare Inepologlou Cc: Larry Garfield; internals@lists.php.net Subject: Re: [PHP-DEV] DateTime improvement On

Re: [PHP-DEV] DateTime improvement

2012-12-20 Thread Peter Cowburn
On 20 December 2012 20:06, Lazare Inepologlou wrote: >> Of course, I have no idea if anyone in userspace is using > DateTimeImmutable... > > Well, it seems unlikely, unless he is Yoda or French. > > I mean, in English, it is common to put the adjective in front of the noun, > isn't it? Class name

Re: [PHP-DEV] DateTime improvement

2012-12-20 Thread Lazare Inepologlou
> Of course, I have no idea if anyone in userspace is using DateTimeImmutable... Well, it seems unlikely, unless he is Yoda or French. I mean, in English, it is common to put the adjective in front of the noun, isn't it? Lazare INEPOLOGLOU Ingénieur Logiciel 2012/12/20 Larry Garfield > I've

Re: [PHP-DEV] DateTime improvement

2012-12-20 Thread Larry Garfield
I've seen DateTimeValue used elsewhere for userspace immutable date time objects. Whether that indicates we SHOULD or SHOULD NOT use that for an in-C version, I don't know. (I'm inclined to say should-but-namespace, but I don't know if we're doing that yet.) Of course, I have no idea if anyo

Re: [PHP-DEV] DateTime improvement

2012-12-17 Thread Adam Harvey
On 18 December 2012 04:52, Lars Strojny wrote: > I would go with DateTimeValue or DateTimeImmutable as well. +1. I'd prefer DateTimeImmutable personally because it describes what it is better than the other options. Adam "bikeshed" Harvey -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] DateTime improvement

2012-12-17 Thread Lars Strojny
Hi Derick, I would go with DateTimeValue or DateTimeImmutable as well. Am 17.12.2012 um 19:42 schrieb Benjamin Eberlei : > On Mon, Dec 17, 2012 at 5:48 PM, Derick Rethans wrote: > I went for DateTimePoint. Point as in "Point in time". I am not too > happy with the name, but I think it works bet

Re: [PHP-DEV] DateTime improvement

2012-12-17 Thread Benjamin Eberlei
On Mon, Dec 17, 2012 at 5:48 PM, Derick Rethans wrote: > > I went for DateTimePoint. Point as in "Point in time". I am not too > happy with the name, but I think it works better than DateTimeImmutable > as that just sounds quircky. I'm still fixing up a few things and adding > some test cases. I t

Re: [PHP-DEV] DateTime improvement

2012-12-17 Thread Derick Rethans
On Sun, 16 Dec 2012, Lars Strojny wrote: > Am 16.12.2012 um 13:21 schrieb Derick Rethans : > > > On Tue, 11 Dec 2012, Derick Rethans wrote: > > > >> On Mon, 10 Dec 2012, Herman Radtke wrote: > >> > >>> Another option is to make an ImmutableDateTime class. The DateTime > >>> class could actuall

Re: [PHP-DEV] DateTime improvement

2012-12-16 Thread Derick Rethans
On Sun, 16 Dec 2012, Stas Malyshev wrote: > > Al the methods will *still* return the modified DateTime object - > > it's just that the one that you *call* f.e. ->modify() on won't > > change anymore. > > Doesn't it mean you can just call clone() on it in modifier methods > before doing anythin

Re: [PHP-DEV] DateTime improvement

2012-12-16 Thread Stas Malyshev
Hi! > Al the methods will *still* return the modified DateTime object - it's > just that the one that you *call* f.e. ->modify() on won't change > anymore. Doesn't it mean you can just call clone() on it in modifier methods before doing anything else? -- Stanislav Malyshev, Software Architect

Re: [PHP-DEV] DateTime improvement

2012-12-16 Thread Derick Rethans
On Sun, 16 Dec 2012, Lester Caine wrote: > > > I'm not really against that, but we do need to use the Date namespace - > > > >>so DateTimeImmutable. It might be trickier to do than it sounds > > > >>though... > > > > > > I've started hacking on this - with some luck I'm done before PHP 5.5 > > >

Re: [PHP-DEV] DateTime improvement

2012-12-16 Thread Никита
I have actually started too, but I made it w/o inheritance from DateTime, and I made many of inline functions to avoid code repetition, so I don't know how good is it. The code on my work computer, so I can show it tomorrow. Derick Rethans писал(а) в своём письме Sun, 16 Dec 2012 16:21:4

Re: [PHP-DEV] DateTime improvement

2012-12-16 Thread Lester Caine
I'm not really against that, but we do need to use the Date namespace - >>so DateTimeImmutable. It might be trickier to do than it sounds >>though... I've started hacking on this - with some luck I'm done before PHP 5.5 beta1. Am I missing something here? Isn't this just making the object conte

Re: [PHP-DEV] DateTime improvement

2012-12-16 Thread Lars Strojny
This is so cool, thanks Derick! If you need help with testing or anything else, let me know. Am 16.12.2012 um 13:21 schrieb Derick Rethans : > On Tue, 11 Dec 2012, Derick Rethans wrote: > >> On Mon, 10 Dec 2012, Herman Radtke wrote: >> >>> Another option is to make an ImmutableDateTime class.

Re: [PHP-DEV] DateTime improvement

2012-12-16 Thread Derick Rethans
On Tue, 11 Dec 2012, Derick Rethans wrote: > On Mon, 10 Dec 2012, Herman Radtke wrote: > > > Another option is to make an ImmutableDateTime class. The DateTime > > class could actually be changed to inherit the ImmutableDateTime > > class. The only extensions on the DateTime class would be the mu

Re: [PHP-DEV] DateTime improvement

2012-12-11 Thread Никита
Stas Malyshev писал(а) в своём письме Tue, 11 Dec 2012 21:06:05 +0400: Hi! As Nikita says, from an ORM perspective, an object is always immutable (at least with current implementations I know of), and that's because they can simply use the object hashes to identify two different objects.

Re: [PHP-DEV] DateTime improvement

2012-12-11 Thread Stas Malyshev
Hi! > @Stas a DateTime object is the perfect representation of what in DB > world has dozens of different representations. The reasoning behind it > is exactly the same as having a DateTime object vs having a date+time > string. You are confusing internal PHP representation with object identity v

Re: [PHP-DEV] DateTime improvement

2012-12-11 Thread Stas Malyshev
Hi! > strings/timestamps (it could be database's representation of date like > "2010-10-23" or just integer with timestamp) or it could be objects of > DateTime. More efficient and logical way would be objects, but that way > you must aware users that they shouldn't modify values of DateTime

Re: [PHP-DEV] DateTime improvement

2012-12-11 Thread Daniel Ribeiro Gomes
People tend to desire API changes that go on the same directions they are going. That's nature... Daniel Ribeiro Gomes Pereira Twitter | Facebook | LinkedIn

Re: [PHP-DEV] DateTime improvement

2012-12-11 Thread Stas Malyshev
Hi! > As Nikita says, from an ORM perspective, an object is always immutable > (at least with current implementations I know of), and that's because > they can simply use the object hashes to identify two different objects. Why for ORM Date is even an object? In most databases, date is a basic va

Re: [PHP-DEV] DateTime improvement

2012-12-11 Thread Marco Pivetta
As Nikita says, from an ORM perspective, an object is always immutable (at least with current implementations I know of), and that's because they can simply use the object hashes to identify two different objects. While this may be a niche to many of you, I've encountered a quite big amount of peo

Re: [PHP-DEV] DateTime improvement

2012-12-11 Thread Nikita Nefedov
Hi! Date is immutable, but there's no reason why date object should be able to represent only one date. Reference to Java is not exactly applicable here, as many problems existing in Java (thread safety, long-living object references, etc.) do not exist in PHP. Say we have a blog post entity,

Re: [PHP-DEV] DateTime improvement

2012-12-10 Thread Derick Rethans
On Mon, 10 Dec 2012, Herman Radtke wrote: > On Mon, Dec 10, 2012 at 11:39 AM, Ángel González wrote: > > On 10/12/12 16:18, Nikita Nefedov wrote: > >> So there had been at least two or three messages (subjects) about > >> DateTime object and everytime there was this problem - people tend to > >> t

Re: [PHP-DEV] DateTime improvement

2012-12-10 Thread Stas Malyshev
Hi! > As long as we know, it's not so good - date is immutable by nature. I > don't want to write here why it's so, I will just throw this link: > http://www.ibm.com/developerworks/java/library/j-jtp02183/index.html Date is immutable, but there's no reason why date object should be able to re

Re: [PHP-DEV] DateTime improvement

2012-12-10 Thread David Muir
On 11/12/12 06:59, Herman Radtke wrote: On Mon, Dec 10, 2012 at 11:39 AM, Ángel González wrote: On 10/12/12 16:18, Nikita Nefedov wrote: So there had been at least two or three messages (subjects) about DateTime object and everytime there was this problem - people tend to take DateTime object

Re: [PHP-DEV] DateTime improvement

2012-12-10 Thread Herman Radtke
On Mon, Dec 10, 2012 at 11:39 AM, Ángel González wrote: > On 10/12/12 16:18, Nikita Nefedov wrote: >> So there had been at least two or three messages (subjects) about >> DateTime object and everytime there was this problem - people tend to >> take DateTime object as mutable object and it really i

Re: [PHP-DEV] DateTime improvement

2012-12-10 Thread Ángel González
On 10/12/12 16:18, Nikita Nefedov wrote: > So there had been at least two or three messages (subjects) about > DateTime object and everytime there was this problem - people tend to > take DateTime object as mutable object and it really is. > As long as we know, it's not so good - date is immutable

[PHP-DEV] DateTime improvement

2012-12-10 Thread Nikita Nefedov
So there had been at least two or three messages (subjects) about DateTime object and everytime there was this problem - people tend to take DateTime object as mutable object and it really is. As long as we know, it's not so good - date is immutable by nature. I don't want to write here why i

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Derick Rethans
On Mon, 26 Nov 2012, Nikita Nefedov wrote: > On Mon, 26 Nov 2012 15:06:09 +0400, Ivan Enderlin @ Hoa > wrote: > > > I would to modify a \DateTime object to the current time, thus I > > wrote this: > > > > $d = new \DateTime('+1 hour'); > > $d->modify('now'); > > > > It did not work. Why? Beca

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Nikita Nefedov
On Mon, 26 Nov 2012 15:06:09 +0400, Ivan Enderlin @ Hoa wrote: Hi internals, I would to modify a \DateTime object to the current time, thus I wrote this: $d = new \DateTime('+1 hour'); $d->modify('now'); It did not work. Why? Because the documentation (http://php.net/datetime.formats.

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Ivan Enderlin @ Hoa
On 26/11/12 13:02, Derick Rethans wrote: On Mon, 26 Nov 2012, Ivan Enderlin @ Hoa wrote: On 26/11/12 12:25, Sebastian Krebs wrote: 2012/11/26 Ivan Enderlin @ Hoa I would to modify a \DateTime object to the current time, thus I wrote this: $d = new \DateTime('+1 hour'); $d->modify('now');

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Derick Rethans
On Mon, 26 Nov 2012, Ivan Enderlin @ Hoa wrote: > On 26/11/12 12:25, Sebastian Krebs wrote: > > 2012/11/26 Ivan Enderlin @ Hoa > > > > > I would to modify a \DateTime object to the current time, thus I wrote > > > this: > > > > > > $d = new \DateTime('+1 hour'); > > > $d->modify('now'); > > >

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Ivan Enderlin @ Hoa
Hi Sebastien, On 26/11/12 12:25, Sebastian Krebs wrote: 2012/11/26 Ivan Enderlin @ Hoa Hi internals, I would to modify a \DateTime object to the current time, thus I wrote this: $d = new \DateTime('+1 hour'); $d->modify('now'); It did not work. Why? Because the documentation (http://php.ne

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Ivan Enderlin @ Hoa
Hi Chris, You didn't understand. I have a \DateTime object, and I would like to change the date and time to the current date and time = now. Imagine you have a \DateTime object that was serialized and you would like to “refresh” it, you need to $d->modify('now'). This is strictly equivalent to

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Sebastian Krebs
2012/11/26 Ivan Enderlin @ Hoa > Hi internals, > > I would to modify a \DateTime object to the current time, thus I wrote > this: > > $d = new \DateTime('+1 hour'); > $d->modify('now'); > > It did not work. Why? Because the documentation (http://php.net/datetime.* > *formats.relative

Re: [PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Chris van Dam
Hi Ivan, $d = new \DateTime('+1 hour', new \DateTimeZone('Europe/Amsterdam')); Is exactly the same as: // Current timestamp with timezone $d = new \DateTime(null, new \DateTimeZone('Europe/Amsterdam')); // Add 1 hour to the timestamp with timezone $d->modify('+1 hour'); This is what you would

[PHP-DEV] DateTime::modify('now') is ignored, why?

2012-11-26 Thread Ivan Enderlin @ Hoa
Hi internals, I would to modify a \DateTime object to the current time, thus I wrote this: $d = new \DateTime('+1 hour'); $d->modify('now'); It did not work. Why? Because the documentation (http://php.net/datetime.formats.relative) says: “Now - this is simply ignored”. Really? But the behavio

[PHP-DEV] DateTime fixes and 5.4 release plan

2011-12-29 Thread Daniel Convissor
Hi Folks: David mentioned the following in the git migration email: >Expect the php-src migration in 14-21 days after 5.4 final. Can 5.4 final please be held off until the DateTime fixes for transitions (such as Standard / Daylight time) are fixed? https://wiki.php.net/rfc/datetime_and_dayli

Re: [PHP-DEV] datetime status

2011-11-21 Thread Stas Malyshev
Hi! For fixing the TLA / Zone Type 2 bugs, focus on the following tests: bug55253.phpt rfc-datetime_and_daylight_saving_time-type2.phpt Those are exactly the two xfails fixed by my patch. DateTime_*-type2-type2.phpt These aren't fixed but it may be related to the f

Re: [PHP-DEV] datetime status

2011-11-21 Thread Derick Rethans
On Mon, 21 Nov 2011, Stas Malyshev wrote: > > That is incorrect, not every timezone DST change is 60 minutes. > > The I would guess this code in do_adjust_timezone() also wrong: > > case TIMELIB_ZONETYPE_ABBR: { > timelib_sll tmp; > > tz

Re: [PHP-DEV] datetime status

2011-11-21 Thread Stas Malyshev
Hi! That is incorrect, not every timezone DST change is 60 minutes. The I would guess this code in do_adjust_timezone() also wrong: case TIMELIB_ZONETYPE_ABBR: { timelib_sll tmp; tz->is_localtime = 1; tmp

Re: [PHP-DEV] datetime status

2011-11-21 Thread Derick Rethans
On Sun, 20 Nov 2011, Stas Malyshev wrote: > We're in RC now, and I'm very concerned about the status of DateTime > functionality (see bugs 60236, 60237 and XFAILs) - I've reported these > problems in June, but not much happened since then. I'm trying to > figure out what's going on there, but I

Re: [PHP-DEV] datetime status

2011-11-21 Thread Derick Rethans
On Sun, 20 Nov 2011, Stas Malyshev wrote: > If it is the former, the patch seems to be pretty simple: > > --- lib/unixtime2tm.c (revision 319533) > +++ lib/unixtime2tm.c (working copy) > @@ -146,7 +146,7 @@ > int z = tm->z; > signed int dst = tm->dst; >

Re: [PHP-DEV] datetime status

2011-11-20 Thread Daniel Convissor
Hi Stas: > We're in RC now, and I'm very concerned about the status of DateTime > functionality (see bugs 60236, 60237 and XFAILs) 60237 is a duplicate of https://bugs.php.net/bug.php?id=55253. I just marked it as such. I suspect the remaining two bugs are related to the same underlying problem

[PHP-DEV] datetime status

2011-11-20 Thread Stas Malyshev
Hi! We're in RC now, and I'm very concerned about the status of DateTime functionality (see bugs 60236, 60237 and XFAILs) - I've reported these problems in June, but not much happened since then. I'm trying to figure out what's going on there, but I'm not sure if I understand the code correct

Re: [PHP-DEV] DateTime and setlocale()

2007-07-11 Thread Derick Rethans
On Wed, 11 Jul 2007, Brian Moon wrote: > I was just wondering if it was intentional to ignore setlocale() in the new > DateTime object and its friends? That is a real let down if it was > intentional. Maybe its just a future feature? It's intentional for PHP 5.2, not for PHP 6.0. More will come

[PHP-DEV] DateTime and setlocale()

2007-07-11 Thread Brian Moon
I was just wondering if it was intentional to ignore setlocale() in the new DateTime object and its friends? That is a real let down if it was intentional. Maybe its just a future feature? -- Brian Moon Senior Developer -- http://dealnews.com/ It's good to be chea

Re: [PHP-DEV] Datetime problem

2007-03-28 Thread Rasmus Lerdorf
This isn't going to change. But you can rename it yourself in ext/date/php_date.c. Just look for: INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date); And put whatever name you want there. -Rasmus Mauro N. Infantino wrote: > Hi all, > > I know I've asked this before, but I couldn't find

[PHP-DEV] Datetime problem

2007-03-28 Thread Mauro N. Infantino
Hi all, I know I've asked this before, but I couldn't find a solution (I'm not asking for an easy one, just a viable solution). In my last email I didn't include the reasons for my request, so I'll write them now. When we started with PHP5 there were no built-in PHP classes. This logically means

Re: [PHP-DEV] DateTime object equality

2007-03-05 Thread Richard Quadling
It would be interesting to know what other internal classes falsely pass this non-identity comparison. Then two new documentation entities could be used to say that non-identity comparison is or is not possible with this class. In my installation, I have 95 built in classes (with no extensions a

[PHP-DEV] DateTime object equality

2007-03-04 Thread Hans Lellelid
Hi all, DateTime equality (not identity) appears to be broken. I've created a ticket for this issue (http://bugs.php.net/bug.php?id=40691), which keeps getting marked as bogus by Ilia. This may be a more appropriate issue to raise on list, as I seem to be having both a very hard time making my p

[PHP-DEV] DateTime object equality

2007-03-04 Thread Hans Lellelid
Hi all, DateTime equality (not identity) appears to be broken. I've created a ticket for this issue (http://bugs.php.net/bug.php?id=40691), which keeps getting marked as bogus by Ilia. This may be a more appropriate issue to raise on list, as I seem to be having both a very hard time making my p

[PHP-DEV] DateTime

2006-08-14 Thread Michael Walter
Hi, Is it on purpose that DateTime objects cannot be cloned? Regards, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php