In function advpoll_get_data, I found these code:

if ($node->advpoll_dates) {
$data['start_date'] = (isset($node->advpoll_dates[$lang])) ? strtotime($node->advpoll_dates[$lang][0]['value'] . ' UTC') : strtotime($node->advpoll_dates[LANGUAGE_NONE][0]['value'] . ' UTC');
$data['end_date'] = (isset($node->advpoll_dates[$lang])) ? strtotime($node->advpoll_dates[$lang][0]['value2'] . ' UTC') : strtotime($node->advpoll_dates[LANGUAGE_NONE][0]['value2'] . 'UTC');
}

If you use UTC to format start_date and end_date, the time will conflict with the site default timezoom. My site default timezoom is Asia/Shanghai, If in the code using UTC, it will differ 8 hours.

CommentFileSizeAuthor
advpoll-dont-need-UTC.patch1.07 KBwuxiaogu

Comments

wuxiaogu created an issue. See original summary.

tripper54’s picture

Status: Active » Needs review
tripper54’s picture

Status: Needs review » Closed (duplicate)

Thanks for submitting this patch. This issue is duplicated at #2709169: Poll availability date does not calculate correctly with non-UTC time zones . I'm closing this issue in favour of the newer one as the patch there extracts some duplicated logic.