datetime object changes itself in latte

17 days ago

dTTb
Member | 3
+
0
-

Hello

I encountered weird behavior

in template file:

<?php
{dump $book->newsdate}
{dump $book->newsdate}
{dump $book->newsdate}
?>

and corresponding part of dumps (http://prntscr.com/f70sxc)

<?php
$book->newsdate
Nette\Utils\DateTime #0f32
date => "2017-05-12 06:27:10.000000" (26)
timezone_type => 3
timezone => "Europe/Prague" (13)

$book->newsdate
Nette\Utils\DateTime #0f32
date => "2017-05-12 06:27:10.000000" (26)
timezone_type => 3
timezone => "Europe/Prague" (13)

$book->newsdate
Nette\Utils\DateTime #0f32
date => "2017-05-26 06:27:10.000000" (26)
timezone_type => 3
timezone => "Europe/Prague" (13)
?>

Do you have any idea what happened here? Or how could I investigate this issue?
To be honest, I'm out of ideas.

17 days ago

Jan Tvrdík
Nette guru | 2510
+
0
-

I've seen this behavior before but I unfortunately don't remember what caused this or how to fix this.
Have you tried using different PHP version?

17 days ago

dTTb
Member | 3
+
0
-

Unfortunately, I can confirm this only on php 5.6.30.

Board footer

Hostováno na e-infrastruktuře CESNET. Děkujeme za podporu sdružení CESNET, z.s.p.o.