Not logged in. · Lost password · Register
Forum: Support Bug reports and troubleshooting RSS
Log viewer timezone
Page:  previous  1  2  3  4  next 
Avatar
Saxtus #31
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
In reply to post ID 10219
Oh... I forgot about that...
Meh... either way XMPP support didn't work well because of Gtalk, so I dumped it but correct time is of the essence!
The Answer to Life, the Universe, and Everything = 42
jense #32
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
In reply to post ID 10213
Quote by Yves:
What happened by now: I have changed the code as suggested by Saxtus. So all timestamps are converted to the board's default timezone, respecting the board's default DST switch, before a log line is written[...]
Could this change be protected via rc?  UNB1 is at present really flexible and consistent concerning the use of time zones: any stored data is in the server's time zone, any displayed data is either in the board's time zone (for guests) or in the user's time zone.  In fact, I really think it is the right thing(TM) that stored and displayed time zone are treated separately.
The only effects this has on the uniqueness of log entries:
  • When updating the board code from yesterday to tomorrow, log entries' timestamps may either skip to the future or repeat a few hours. If the board timezone and system timezone already match, nothing changes at all.
So, in order to being able to interpret the times of my old log files (of course, under the condition that board and server time do not coincide) I have to switch the board time (and I have to write down the time of the update in order to identify the time zone inside my logfiles)?!?
Converting to UTC instead of board timezone only eliminates the second point, but introduces massive deviations from day breaks comparing to any local timezone. [...]
Please, at least briefly try my suggestion.  This way nothing has to be changed on-disk, and there can even be administrators in different time zones, which get adapted times.  Take as primary reason: that's just how it works anywhere else in the board...
As I said, the change of the log timezone to the board's default timezone will be included in the next release. I hope to get some more pending changes done tomorrow and put up a new code snapshot at last until the weekend.
Pretty, pretty please: no or not without an option to disable this change...
Alala, Alala, Gimme three wishes - CSS
jense #33
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
In reply to post #31
Quote by Saxtus:
but correct time is of the essence!
Listen, Yves... ;)
Alala, Alala, Gimme three wishes - CSS
jense #34
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
In reply to post ID 10210
Even if it's not needed anymore: in my modified logviewer.php the replacement UnbConvertTimezone()UnbConvertTimezone(0) is needed in order to suppress a PHP warning.  Missing arguments default to 0, so I did not recognize it earlier...
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #35
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #32
I'm a bit overwhelmed by this thread...

Quote by jense:
Take as primary reason: that's just how it works anywhere else in the board...

It's not. Anywhere else a UNIX (UTC) timestamp is stored in the database. The log keeps its entires in files that are named by a certain timezone, days and all that. It also cannot be filtered in anything else than the time string stored on-disk.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Yves (Administrator) #36
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #31
PHP 4 shouldn't be a target platform anyway since the PHP team stopped support for it. But I'm trying to touch this compatibility thing as little as possible. Any new works currently go into UNB2. It will require PHP 5.1.something, MySQL 5.0 (if MySQL, other DBMS are also supported this time) (which doesn't seem so future anymore, now after a whole year...).
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Yves (Administrator) #37
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
PS: For a few moments, a new code version is available. It includes all changes that I have confirmed here plus a few of Jens' patches.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
This post was edited on 2009-03-05, 19:56 by Yves.
jense #38
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
In reply to post #35
Quote by Yves:
It's not. Anywhere else a UNIX (UTC) timestamp is stored in the database.
Hm, are you sure?  I exactly checked that and found something like EditDate = time(), i.e. *local* time.  I'll recheck.

In UNB2 you're using UTC, IIRC.
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #39
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
time() returns a UNIX timestamp (seconds since 1970-01-01T00:00:00+00:00), and those are always in UTC.

In UNB2, the database data type DATE/DATETIME is used, which accepts a real string like '2009-03-05T23:20:04'. This is far more obvious than a UNIX timestamp which is always UTC, even if PHP's date() function formats it in the current timezone. (gmdate() would format it as-is in UTC.)
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Saxtus #40
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
Out of curiosity: Does UNB2 continues to ask just the UTC difference at users profiles?
The Answer to Life, the Universe, and Everything = 42
Avatar
Yves (Administrator) #41
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This is not specified yet.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #42
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
In reply to post #39
Quote by Yves:
time() returns a UNIX timestamp (seconds since 1970-01-01T00:00:00+00:00), and those are always in UTC.
...rebooting... yes, of course.  After reading everything about, date(), time(), gmdate(), gmmktime() I got apparently pretty much confused.
Alala, Alala, Gimme three wishes - CSS
jense #43
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
In reply to post #41
Quote by Yves:
This is not specified yet.
Sidenote: with the DateTime class (as of PHP 5.2?!), playing with time zones is possible without even touching the local server time.  Almost everything can be done then (call it overkill)...

@Saxtus:
your browser sends a cookie to the server with the time of your local (client) machine.  This value takes precendence over the board's time, however, it gets itself overridden by a user's configuration other than default.
So, in theory, if you reconfigure your user time zone to default, the board should show the correct time including DST and whatsoever.  Note, that the cookie needs to be send, so maybe the time will be correct only on the second page after a time change, but two times a year is probably better than several weeks in spring and fall... :-)
Alala, Alala, Gimme three wishes - CSS
Avatar
Saxtus #44
Member since Jan 2007 · 84 posts · Location: Athens, Greece
Group memberships: Members
Show profile · Link to this post
Cookie? Don't you mean the HTTP request?
There is a great javascript function that gets machine's timezone (as configured by windows).
I've only seen it work right at Google calendar API functions however...
The Answer to Life, the Universe, and Everything = 42
jense #45
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
UNB uses just this function and sends a cookie back to the forum's server (name: UnbTimezone).  Unfortunately, javascript is executed after receiving the page, so that the submitted time zone is only recognized from the second page request on...
Alala, Alala, Gimme three wishes - CSS
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:  previous  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 187.9 ms (139.5 ms) · 143 database queries in 115.9 ms
Current time: 2013-05-19, 01:40:04 (UTC +02:00)