Improve date handling in getDate method#15
Conversation
Handle Unix timestamp strings in getDate method.
|
the underlying error was: 2026-03-19T21:49:00+01:00 ERR: HORDE Returning HTTP 500 while handling Sync command. Error is: Zeitformat (1773944669) nicht erkannt [pid 1215731 on line 165 of "horde-deployment/vendor/horde/horde/rpc.php"] |
|
alternative is to pimp dates c'tor: if (is_string($date)) { |
No, that's broken behaviour - ints are supposedly unix timestamps, '20010203040506' should NOT be treated the same way. I can limit "strings are timestamps" to (optional -) + exactly 11 digit chars and still we won't be too happy with it. Lesson learned: Constructors should eat typed objects but we will not purposefully change Horde_Date in lib/ now. Going forward, best feed DateTimeInterface objects into Horde_Date (if feasible, beware of timezones) or cast to int when you are sure it's a timestamp. |
…s unix timestamps, otherwise delegate to DateTime. Also relates to #6 fix
Release version 3.0.0-beta7 fix: Address horde/ActiveSync#15 - allow some timestamp-ish strings as unix timestamps, otherwise delegate to DateTime.
Handle Unix timestamp strings in getDate method.