Skip to content

Set editor's time zone adjustment fails for time zones with different daylight saving rules #2654

Open
@jonathonsurles

Description

When editing set dates, the time adjustment - intended to always display times as server time - is set as a constant, but this doesn't handle cases when the offset changes, such as when one time zone observes daylight saving time when the other does not.

Example time zones:
Central Time (US & Canada) - Standard: UTC-6; DST: UTC-5
Mountain Time (US & Canada) - Standard: UTC-7; DST: UTC-6
Arizona - Standard: UTC-7, no DST

The server is set to America/Chicago (U.S. Central), and today is Jan 10, so no daylight saving time.
When the client is on U.S. Central Time, everything appears as we expect.
When the client is on U.S. Mountain Time, it also works; WeBWorK adjusts the underlying time, so it appears as if you're editing in the server's local time.
When the client is in Arizona Time, this is where we see problems. WeBWorK computes the current time difference of 1 hour and it works until a time switch. After March 9th, when most of the U.S. begins daylight saving time, the true difference jumps to 2 hours, but WeBWorK still only adjusts by 1 hour. So, the editor shows a time at 10:59 PM, but it saves a time at 11:59 PM. Similarly, if the user saves a time at 11:59 PM with this incorrect offset, it will be converted to 12:59 AM the next day on the server's time zone.

Sets as they appear on the server:
image
Central Time client editor (Server time zone):
image
Mountain Time client editor:
image
Arizona client editor:
image
Arizona client changing dates to appear correct in the editor:
image
Server dates after saving above changes:
image

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions