WordPress.org

Ready to get started?Download WordPress

Forums

Weekly Class Schedule
[resolved] Todays classes wrong for my time zone (2 posts)

  1. frumbert
    Member
    Posted 1 year ago #

    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/

  2. frumbert
    Member
    Posted 1 year ago #

    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');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic