• Resolved resting

    (@resting)


    I believe its due to timezone issue.
    The server is set to UTC, and software local timezone is set to Asia/Singapore (UTC +8).
    After the line $time = $this->_registry->get( 'date.time' ); in widget.php
    I trie $time->format() to get the current time and got a time that is -8 of local time.
    Is there anyway to get it to return the local time instead of server time?

    Have also tried to set date manually with timezone,

    $time =$time->set_date_time(‘now’, ‘Asia/Singapore’);
    $time->format()

    but its still -8 behind local time.

    https://www.ads-software.com/plugins/all-in-one-event-calendar/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    “Display events in calendar time zone” option should help, go to Events > Settings > Display events in calendar time zone, and select the option.

    Thread Starter resting

    (@resting)

    Hi,

    Thanks for the suggestion, I’d checked the option, but it didn’t work.
    There’s a line in widget.php which is

    // Get localized time
        $timestamp = $time->format_to_gmt();

    right after that I tried printing the $timestamp and it still shows -8 time.

    Maybe format_to_gmt is causing it to ignore timezone so I tried,

    $timestamp = $time->format();

    But it shows the same time as format_to_gmt()

    This is causing problems in the widget when I set it to 1 day’s event. That is, I only want to show today’s events. But due to the timestamp offset, it may or may not show events that’s supposed to start the next day.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘$time->format() displays wrong date’ is closed to new replies.