[dev] Implicit conversion of mysql TIMESTAMP type to Horde_Date

Ralf Lang lang at b1-systems.de
Mon Jan 7 17:03:43 UTC 2019


Am 07.01.19 um 16:25 schrieb Ralf Lang:
> Hi,
>
> I am currently a little puzzled by either Horde_Db or Horde_Rdo
> implicitly converting TIMESTAMP db fields to Horde_Date values.
> Unfortunately, it has the wrong idea about the timezone of TIMESTAMP.
>
> A timestamp stored as 2018-05-16 04:00:00 is returned as 2018-05-16
> 04:00:00 Europe/Berlin.
>
> The database time_zone is SYSTEM. The system timezone is UTC.
>
> To understand the issue better, I'd rather turn off the automatic
> conversion and do the conversion to Horde_Date manually. Is there any
> config for Horde_Db to govern this?


Looks like it's this line:
https://github.com/horde/Rdo/blob/5d16dda64ed249400b18ba4f62fcbcd3443d9d83/lib/Horde/Rdo/Mapper.php#L230

For a hotfix in my local issue, I may overload mapFields (60 loc) in the
derived Mapper. Still, I think assuming the backend data is always in
the frontend's default timezone might not always be right.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 1757 bytes
Desc: not available
URL: <https://lists.horde.org/archives/dev/attachments/20190107/dc467d29/attachment.bin>


More information about the dev mailing list