[dev] Unix timestamp: Horde_Date timestamp() behaves different than Horde_Date->format('U')

Ralf Lang lang at b1-systems.de
Mon Dec 13 12:23:12 UTC 2021


Is this a bug or intentional?

For any relevant date before 2038,

Horde_Date->timestamp() ignores the Date object's set timezone in favor 
of the system timezone.
Horde_Date->format('U') instead uses the Date object's set timezone.

I will come up with a unit test to illustrate that once I have time to 
research that. It looks like both take different code paths, mktime() vs 
conversion to DateTime and then running format().

-- 
Ralf Lang
Linux Consultant / Developer
Tel.: +49-170-6381563
Mail: lang at b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537



More information about the dev mailing list