Opened 18 years ago
Closed 18 years ago
#1650 closed patch (invalid)
mythweb doesn't handle daylight savings time correctly
Reported by: | 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)
Change History (5)
Changed 18 years ago by
Attachment: | mythweb_tz.patch added |
---|
comment:1 Changed 18 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
conf.php doesn't exist anymore. Besides, you should set the timezone system-wide, not in the web app.
comment:2 Changed 18 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
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 18 years ago by
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 18 years ago by
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
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.
patch to add timezone for each page