• How do i get the calendar to display the current day iin my timezone ie. UTC +12.

    My Blog is set as UTC+12 but calendar still displaying wrong day?

Viewing 6 replies - 1 through 6 (of 6 total)
  • I was having the same problem and just fixed it.

    Open ec_calendar.class.php
    Do a search for

    if ("$month/$day/$year" == date('m/j/Y'))

    and replace it with

    if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $month == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $year == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) )

    Several people I read were having the same issue so I tried to fix it myself and it seems to work.

    Try the Automatic Timezone plugin.

    I did but it would work for this plugin.
    I’m not sure but I think this code

    date('m/j/Y')

    was taking from the server directly when I’m in complete different countries so the time was off. By changing that line of code, I made it include the gmt_offset which was set by WP and Automatic Timezone.

    Hi
    I tried both the solutions but the pop-up in my calendar still shows the wrong day(a day before the actual). Could you please provide a solution?

    This is a quick fix when you have time() or mktime() calls that are returning GMT. Doesn’t fix the actual problem but if you don’t feel like recoding the widget calendar it does the job nicely.

    Open up your ec_calendar.class.php file, then paste the following line of code somewhere after the <?php (basically before the comments start)

    date_default_timezone_set(‘America/Los_Angeles’);
    Replace ‘America\Los_Angeles’ with the correct time zone you want to use from this list: https://ch2.php.net/manual/en/timezones.php

    Sidenote: why does the Large Calendar get the localized time zone but not the widget? And why is the coding so different???

    otakuoverlord – Tried the others with no joy but your solution absolutely did the trick for me! Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Events Calendar] Recognise my time zone’ is closed to new replies.