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
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
2012/11/26 Ivan Enderlin @ Hoa ivan.ender...@hoa-project.net
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.*
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
Hi Sebastien,
On 26/11/12 12:25, Sebastian Krebs wrote:
2012/11/26 Ivan Enderlin @ Hoa ivan.ender...@hoa-project.net
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
On Mon, 26 Nov 2012, Ivan Enderlin @ Hoa wrote:
On 26/11/12 12:25, Sebastian Krebs wrote:
2012/11/26 Ivan Enderlin @ Hoa ivan.ender...@hoa-project.net
I would to modify a \DateTime object to the current time, thus I wrote
this:
$d = new \DateTime('+1 hour');
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 ivan.ender...@hoa-project.net
I would to modify a \DateTime object to the current time, thus I wrote
this:
$d = new
On Mon, 26 Nov 2012 15:06:09 +0400, Ivan Enderlin @ Hoa
ivan.ender...@hoa-project.net 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
On Mon, 26 Nov 2012, Nikita Nefedov wrote:
On Mon, 26 Nov 2012 15:06:09 +0400, Ivan Enderlin @ Hoa
ivan.ender...@hoa-project.net 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