Skip to content

Commit c317854

Browse files
committed
more timezone conversion
1 parent 978fd4e commit c317854

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

class/Form/ItemForm.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,11 @@ public function createElements($obj)
147147
if (!\is_object($GLOBALS['xoopsUser'])) {
148148
$group = [XOOPS_GROUP_ANONYMOUS];
149149
$currentUid = 0;
150+
$timeoffset = 0;
150151
} else {
151152
$group = $GLOBALS['xoopsUser']->getGroups();
152153
$currentUid = $GLOBALS['xoopsUser']->uid();
154+
$timeoffset = $GLOBALS['xoopsUser']->getVar('timezone_offset');
153155
}
154156

155157
$this->setExtra('enctype="multipart/form-data"');
@@ -359,7 +361,7 @@ public function createElements($obj)
359361
}
360362

361363
$dateExpireYesNo = new \XoopsFormRadioYN('', 'use_expire_yn', $dateexpire_opt);
362-
$dateexpire = \strtotime(\formatTimestamp($dateexpire)); //set to user timezone
364+
$dateexpire = formatTimestamp($dateexpire, 'U', $timeoffset);
363365
$dateexpire_datetime = new \XoopsFormDateTime('', 'dateexpire', $size = 15, $dateexpire, true);
364366
if (0 == $dateexpire_opt) {
365367
$dateexpire_datetime->setExtra('disabled="disabled"');

0 commit comments

Comments
 (0)