Not logged in. · Lost password · Register
Forum: Support Bug reports and troubleshooting RSS
Log viewer timezone
Page:  1  2  3  4  next 
Avatar
Saxtus #1
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
Subject: Log viewer timezone
It seems that it follows only server's time without obeying to the board's setting or overridden by the user’s browser preferences.
The Answer to Life, the Universe, and Everything = 42
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It cannot follow the user's timezone because the log entries are stored in one file per day. The current (simple) implementation would end up in a mess if one log day requires to read multiple files, which just isn't what it was designed for.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Saxtus #3
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
Maybe read the UNB configuration's timezone as set at global options or add a drop down menu in the plug-in's options to set manually a timezone and just adjust how the time is converted on screen?
The Answer to Life, the Universe, and Everything = 42
Avatar
Yves (Administrator) #4
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It would still have to do some translation between displayed time and stored time. Right now, the code can only read the file with the name of the date you selected. If you're in UTC+0500, the server's in UTC and you select all log entries from 2009-02-21, you'd get to see anything between 2009-02-21T05:00 and 2009-02-22T05:00 in your local timezone. Plus would the date need to be displayed because you might not know what day that time actually belongs to; this takes more of the valuable display space. For now I can only recommend to set the server's timezone to whatever timezone the administrator himself is (usually) located in, which should automatically be the case if you don't use a server from the other side of the planet.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Saxtus #5
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
Unfortunately this is impossible for most Europeans that rent a virtual private server in US but I understand where the problem lies.
The Answer to Life, the Universe, and Everything = 42
Avatar
Keith #6
User title: 漢字おたく
Member since Feb 2007 · 60 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Why not store the log files according to the board settings (Board configuration -> General Settings -> Date and Time) ?

Germany may use only 1 timezone but the U.S. has 6 timezones. We cannot set the server timezone on shared hosting.  Many people, like myself, use hosting that is on the other side of the planet. In my case, the time difference is 15 hours.
Avatar
Yves (Administrator) #7
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Yes, that would be an idea. I'll look into it.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Yves (Administrator) #8
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Okay, that would work. There's one problem though: Daylight saving time. Damn f%ing daylight saving time. God save us from the saving time, pleeease! There's enough daylight for everybody.

Anyway, the DST setting can only be determined by the server OS. So if the server is in NY and they begin praising the daylight on like March 23, and you (the board admin and most of your audience) are in CA or even Moscow, and you either don't care about the saved daylight or start that festival on April 2, there's nothing you can do. Either the server's DST interval is used and it may work for you [1] or it is generally not used and you may be off by an hour half the year.

[1] If you accept DST made persistent in log timestamps, you still have the problem with one hour of the year appearing twice. Which may probably not be relevant after all... (You cannot tell whether the posting was deleted on Oct 18 at 2:42 dst or 2:42 st = 1:42 dst.)

Any more suggestions as I'm applying that change?
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Saxtus #9
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
When you detect PHP5 (the majority of shared hosting servers upgraded to it), instead of asking the time offset, ask the user's town.
Then you can use date_default_timezone_set.

There is a nice code to populate the town list for a drop down menu here.
The Answer to Life, the Universe, and Everything = 42
jense #10
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Please use GMT: unique (just consider, you're moving a board installation across time zones) and no DST.  All in all its just log files...

AFAICS, the original problem is just a matter of frontend.  If the times are presented with the adminstrator's timezone and there is some indication of the day (additional column with 0 for that at the top or +/- one day, for instance), everythings fine and easy to understand...
Alala, Alala, Gimme three wishes - CSS
Avatar
Saxtus #11
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
You're suggesting to use GMT for saving log files and then you say to present them with administrator's timezone?
How is that possible considering that the log files are saved per-day? The filter will brake...
The Answer to Life, the Universe, and Everything = 42
This post was edited on 2009-03-03, 13:38 by Saxtus.
jense #12
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Converting GMT date/times to any timezone is trivial in PHP.  Then present a list in CP

[ date one ]
time one
time two
...
[ date two ]
time N
time N+1
...

with [...] being a table row, which spans all columns.  Easy, isn't it?
Alala, Alala, Gimme three wishes - CSS
Avatar
Saxtus #13
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
Quote by jense:
Converting GMT date/times to any timezone is trivial in PHP.

No, it isn't.
At least not with current setup of "select time diff from GMT" and the DST changes nightmare.
And still the log filter must be heavily adjusted to convert on the fly what user requested as log files are served by day. We can't ask that from Yves, it's just too boring.
The Answer to Life, the Universe, and Everything = 42
jense #14
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Quote by Saxtus:
Quote by jense:
Converting GMT date/times to any timezone is trivial in PHP.
No, it isn't.
It is.  I see date and times in my selected timezone and with correct DST all over the place.  Where should they come from, if it won't work?
And still the log filter must be heavily adjusted to convert on the fly what user requested as log files are served by day. We can't ask that from Yves, it's just too boring.
Depends.  If it is just converting times, it is a three liner in the logviewer plug-in: read time stamp from $entry['date'] and $entry['time'] via strtotime and write it back with the correct timezone.

There is only one problem: since the date/times are stored in the local time zone into the log files, the dates usually do not match the filename.  The switch to GMT inside the files can only be done for new installations (or via a rc?).
Alala, Alala, Gimme three wishes - CSS
Avatar
Saxtus #15
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
Quote by jense:
It is.  I see date and times in my selected timezone and with correct DST all over the place.  Where should they come from, if it won't work?

http://newsboard.unclassified.de/forum/post/10198 (PHP5 only)
http://www.timeanddate.com/news/time/usa-canada-dst-march-…
The Answer to Life, the Universe, and Everything = 42
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  3  4  next 
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 233.6 ms (146.8 ms) · 139 database queries in 112.5 ms
Current time: 2013-05-21, 23:35:02 (UTC +02:00)