Support » Plugin: Weekly Class Schedule » Todays classes wrong for my time zone

  • Resolved frumbert

    (@frumbert)


    The todays classes widget shows classes for yesterday, up until mid morning, at which point it lists the classes that i have today. My server is in the US but i am in australia. How can i change the plugin so that it has the timezone that i am in not the timezone the server is in (which i cannot change)?

    http://wordpress.org/extend/plugins/weekly-class-schedule/

Viewing 1 replies (of 1 total)
  • frumbert

    (@frumbert)

    Answering my own question here, but I trawled around the net and found this snippet of code, which I put into /wp-content/plugins/weekly-class-scheudule/models/WcsTodayClassesWidget.php

    replace:
    $today = date( 'w', strtotime( 'now' ) );

    with:

    $date = new DateTime();
    $date->setTimezone(new DateTimeZone('Australia/Sydney'));
    $today = $date->format('w');

Viewing 1 replies (of 1 total)
  • The topic ‘Todays classes wrong for my time zone’ is closed to new replies.