Re: Implicit conversion of mysql TIMESTAMP type to Horde_Date

Ralf Lang <[email protected]> Mon, 7 Jan 2019 18:03:43 +0100
Newsgroups gmane.comp.horde.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------7D4A3F92F15B737C23899937
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit


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.


--------------7D4A3F92F15B737C23899937
Content-Type: application/pgp-keys;
 name="pEpkey.asc"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="pEpkey.asc"

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQENBFvSz9ABCAC/D3VOv9UiDxS9rLwc2SYOKj7kg5ERpKULorWII7QcIc8PC5xt
OlxRxI8sg15y8JvtrPo8FJG9RfDiwbqrRSL4nzlIui960c/SM9ayaXR9Q8YPRV93
PVZH94tdMdnO65tsMYmuwMtrN6DOokyT9snS++NHjH7KG2SnGu6lsonLF+Q1oxY4
c+yHZpRcHekTIKU1kuBGq5z/2WvdKq+mmpXOyZMDUDcjta0SsZTWCjbEhvDR69ks
+HleY2okRL+7oIjjwxscikGEU/w60AMl7K+js1sVCImaU/iknNw6zooOqttIQ2D5
TgvMSOhb2J9M4ad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4S0GKXUzjKPgbFe2sqI/zM5E6eWiUwcGT
+AA6lvhJb/YKkQ7jZ69CAc09+sV5HFPKMo19Yxpsz45jXhgtlCsCkqcobtEm90Qg
o3HeZ1gJ0VGKxRHakyAsgh5lfKnpIUCRLxmcYpUTCZ0oLhafrwfKlW3X7x0jBC3f
EbYJmGcUBIH7vTxXcmsfh0Ury7JxMjsywsi9AoeVInpO/cCNYYPlsOgO/98hJYGg
kOgZizmcxHWKR+5qM0ufNQoQYU1OhSovkVtNFSn5+lOMiBwtTA==
=oyfV
-----END PGP PUBLIC KEY BLOCK-----

--------------7D4A3F92F15B737C23899937
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
dev mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]

--------------7D4A3F92F15B737C23899937--