Skip to main content

hikashop_getTime() uses today's UTC offset, so datepicker fields show the previo

More
1 hour 15 minutes ago - 1 hour 14 minutes ago #100000417 by Genr8r
hikashop_getTime() uses today's UTC offset, so datepicker fields show the previous day across a DST change

HikaShop 6.7.1 (same code in 6.6.0), Joomla site timezone America/Los_Angeles, server PHP timezone UTC.

A datepicker custom field stores 20261125000000. In the backend order view and edit form it displays as 11/24/2026. Dates before the DST change display correctly.

Cause: datepickerfield getTimestamp() passes "2026/11/25" to hikashop_getTime(). That falls back to strtotime() and then applies
Code:
$date - $timeoffset*60*60 + date('Z', $date)
, where $timeoffset is computed once from Factory::getDate('now', $timeZone). Today that is UTC-7 (PDT), but 11/25 is in PST, which is UTC-8, so the result is 11/24 23:00 local.

The plugin's "Set hour to noon" option hides the display problem but moves the forbidden-weekday check in check() by a day (a Saturday is rejected as Sunday), so it is not a workaround for us.

Suggested fix: compute the offset for the date being converted, e.g. new DateTime($date, new DateTimeZone($timeZone)) then getTimestamp(), instead of the cached "now" offset.
Last edit: 1 hour 14 minutes ago by Genr8r.

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum