Forums

[Plugin: Events Calendar] Recognise my time zone (5 posts)

  1. kiwia
    Member
    Posted 6 months ago #

    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?

  2. iamjoe
    Member
    Posted 5 months ago #

    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.

  3. SS_Minnow
    Member
    Posted 5 months ago #

    Try the Automatic Timezone plugin.

  4. iamjoe
    Member
    Posted 5 months ago #

    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.

  5. admin_nfbi
    Member
    Posted 4 months ago #

    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?

Reply

You must log in to post.

About this Topic