Opened 14 years ago

Closed 14 years ago

#1650 closed patch (invalid)

mythweb doesn't handle daylight savings time correctly

Reported by: fhriley@… Owned by: xris
Priority: minor Milestone: unknown
Component: mythweb Version:
Severity: medium Keywords:
Cc: Ticket locked: no

Description

If you live in an area that doesn't observe daylight savings time, mythweb's times are off by 1 hour during daylight savings time. The attached patch provides a simple fix by having the user set the timezone in conf.php and then using that value to set the TZ environment variable for each page. Note that I didn't touch the wml theme since I don't know anything about wml.

Attachments (1)

mythweb_tz.patch (1.4 KB) - added by fhriley@… 14 years ago.
patch to add timezone for each page

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by fhriley@…

Attachment: mythweb_tz.patch added

patch to add timezone for each page

comment:1 Changed 14 years ago by xris

Resolution: invalid
Status: newclosed

conf.php doesn't exist anymore. Besides, you should set the timezone system-wide, not in the web app.

comment:2 Changed 14 years ago by anonymous

Resolution: invalid
Status: closedreopened

I disagree. The timezone on my machine *is* set system-wide, but the environment provided by Apache for php does not have the timezone set. If you set your server timezone to America/Phoenix?, you'll see the behavior I'm talking about. If you think about it, this makes sense because a web client can be running from anywhere, and the client may or may not want the server timezone. In mythweb's case, however, I doubt anyone will be running a client from a different timezone so it should be safe to use the server timezone. In addition, my patch doesn't even require the user to set the timezone since it works fine if you live in an area with DST. Do with it what you want, but it *is* broken for users not living with DST.

I'm not using the SVN version, but I can't submit a patch for that as well if you like.

comment:3 Changed 14 years ago by xris

I still don't see what this fixes. Is it a bug in php that it doesn't recognize AZ as a no-DST zone?

Anyway, I'll consider this a feature request to add timzeone information to the session, and will get it added to svn at some point in the near future.

comment:4 Changed 14 years ago by fhriley@…

Resolution: invalid
Status: reopenedclosed

I finally stumbled upon a post that gave me the solution. The following needs to be set in php.ini:

[Date] ; Defines the default timezone used by the date functions date.timezone = America/Phoenix?

I guess PHP can't read the timezone from the system. This is probably good information to add to the README.

Note: See TracTickets for help on using tickets.