Details
-
Bug
-
Resolution: Fixed
-
High
-
1.7.5
-
None
Description
eZ\Publish\Core\FieldType\Time\Value::fromTimestamp uses setTimestamp while eZ\Publish\Core\FieldType\DateAndTime\Value::fromTimestamp uses new \DateTime("@{$timestamp}") which results in an inconsistent handling of these Field Types.
Consider the following PHP example:
$dateTime1 = new \DateTime("@3600"); $dateTime2 = new \DateTime; $dateTime2->setTimestamp(3600); var_dump($dateTime1->format('H:i:s'), $dateTime2->format('H:i:s'));
DateTime modified by setTimestamp takes into the account server timezone, while the one created with "@" format does not.
Attachments
Issue Links
- relates to
-
EZP-28244 Difference between time/date in edit and preview mode
- Closed