Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64043 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19888 invoked from network); 26 Nov 2012 11:06:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2012 11:06:18 -0000 Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:52709] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/C2-26957-52D43B05 for ; Mon, 26 Nov 2012 06:06:15 -0500 Received: from Hwhost2.local (107-178.203-62.cust.bluewin.ch [62.203.178.107]) by host1.trois-doubles.net (Postfix) with ESMTPSA id 295D1201095 for ; Mon, 26 Nov 2012 12:06:10 +0100 (CET) Message-ID: <50B34D21.4080109@hoa-project.net> Date: Mon, 26 Nov 2012 12:06:09 +0100 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/19.0 Thunderbird/19.0a2 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: DateTime::modify('now') is ignored, why? From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") Hi internals, I would to modify a \DateTime object to the current time, thus I wrote th= is: $d =3D new \DateTime('+1 hour'); $d->modify('now'); It did not work. Why? Because the documentation=20 (http://php.net/datetime.formats.relative) says: =93Now - this is simply = ignored=94. Really? But the behavior is pretty straightforward isn't?=20 =93modify to now=94 means =93set to the current date and time and let the= =20 timezone unchanged=94. Thoughts? Best regards. --=20 Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/