Author |
Topic  |
|
Deleted
deleted
    
4116 Posts |
Posted - 31 January 2003 : 17:59:00
|
Having adapted the timezone MOD to v4b04 (alpha02) I have some questions... I'm not sure I understood the logic behind everything (i.e. a bit tired and mixed up).
To keep the foreword short (because the questions are long, sorry for this):
Assume we don't have timezone MOD, like in v3.4... Are the following statements correct?
- What date-time do we store in the database (mainly in post_info.asp)? Is it not strForumTimeAdjust? That value is meant to be in Universal Coordinated Time (UTC) (or GMT). (This must be wron, see the third item)
- When getting the date/time back on screen, it is converted back...
- Users use that to compensate the difference between server timezone and userbase timezone (usually a single country), so strForumTimeAdjust is not necessarily UTC.
- If the strTimeAdjust is not set correctly (e.g. left default 0, or set to a wrong value) values in the database will not be UTC, but in server timezone or in an arbitrary timezone.
- If we change the strTimeAdjust in the middle of forum life, there will be a jump in time depending on the change. So, after the change, one can have temporarily have posts "apperantly made in the future".
- strTimeAdjust does not take the daylight savings automatically into account. But because the sever the forum resides take them into account (if set into correct locale, a must be), there can be a +60 or -60 minutes jump, unless the admin compensates for the change by changing strTimeAdjust.
- This whole process tries to assure (if strTimeAdjust is kept correct always) server movements and daylightsaving changes do not effect the date-time values.
Assuming we HAVE timezone MOD, like in v4b04... Are the following statements correct?
- The idea behind this MOD is four-fold:
* Firstly, it makes it more understandable with providing city names; * secondly it takes the Daylight savings automatically into account ; * third it also makes special timezone differences which have partial hour (30 minute) differences; * fourth it enables the users to set their own time zones, so that they don't need to calculate.
- What it does not is: It does not show what time is in that members timezone. But this can easily be added as another MOD.
Now, here are some questions:
- Is the UTC idea I explained above implemented? (I think it must be a must)
- What is intServerBias for? The code tries to get the timezone offset from java, but if it cannot get it, it is assumed to be zero. It is only used in config.asp to calculate strForumTimeAdjust. It could be used as a verification mechanism (but it is not), it can be the mechanism which compensates for daylight changes, but I cannot be sure on this...
- The logic behind this must be:
* Convert the date-time into UTC correctly, also taking the daylightsavings on the server timezone into account, * Save that UTC date-time into the database * When the data is needed to be shown, it will be shown in users timezone
Are the above correct?
- What is the mechanism that triggers a date-time change in server/member timezones? For members, login/logout/cookie-delete will do it, but is there an automatic way? For server side, it seems the admin has to enter and repost date-time configuration, am I correct? Is there an automatic way?
< |
Stop the WAR! |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 31 January 2003 : 20:24:36
|
1) the value stored is strforumtimeadjust it is meant to be the forum time based on the offset from server time as entered in the admin. it is not meant to be UTC it is the FORUM time 2) No, it is not converted anywhere 3) Users are unable to control any aspect of the time displayed, it displays the forum time to everyone. 4) if left at zero, values stored will be server time 5) yes, this would be true no matter how you controlled the time. 6) yes, that is correct, because forum time is simply an offset from server time 7) they shouldn't affect it since everything is based on server time.
1) The purpose of the mod was to display post times in the users own local timezone. 2) No it doesn't it was never intended as a clock.
1) No, all times even with the timezone mod are based on the server timezone. why is utc a must, it works perfectly ok as it is. 2) the code uses SERVER side javascript to try to ascertain the servers offset from gmt, this caused an error on some servers with older java engines, so if it errors it defaults to zero. (some people do not know the timezone of the server, hence the attempt to do it automatically) it is needed to calculate the initial time offset for the forum. 3) All posts are still therefore stored as FORUM time, they are then converted at display time for the user. 4) it is manual for the forum since its offsets are stored in an app variable, it could be done automatically by saving the next change date in an app variable as well, then check that against todays date before it calculates strforumtimeadjust.
< |
 |
|
Nathan
Help Moderator
    
USA
7664 Posts |
Posted - 31 January 2003 : 20:55:05
|
Wouldn't things become so much more simple if the timezone of the datestamp was included in the stamp when it is stored in the database?
That would make the times in the database detached from the server itself, so a forum could be moved from a server in New York to a server in Sidney (ah crud, spelled it wrong. I hope there are no dangerous Austrailians (doh! spelled that wrong too!) around here!) and the validity of the timestamps would not be compromised.< |
Nathan Bales CoreBoard | Active Users Download |
 |
|
Deleted
deleted
    
4116 Posts |
Posted - 31 January 2003 : 21:22:34
|
Huw, thank you for the answers...
In fact while I was writing this, I was aware that UTC is not used. I tried to summerise the concepts and the logic behind it.
I still think UTC will provide advantages. I'm sure UTC commands are there (cref JavaScript) because it is useful. UTC is Universal Coordinated Time and provides many simplicities to calculations.
Yes, it works as it is now, actually I've got it working in v4b04 also, but knowing it is a standart in International time manipulation, I'm suggesting it as a base.
If I'm not mistaking: If the database values were kept in UTC, a server move to another timezone, or daylight saving changes would not cause a "quantum leap" provided that the old/new timezones are kept correctly and daylight saving are calculated automatically.
Assume server is in GMT+1 and the timezone is set to GMT+1 Member M1 in GMT-5 makes a post on 2003-01-20 11:00 (server time) Database keeps it as 2003-01-20 10:00 (20030120100000) (this is GMT=UTC) Member M1 in GMT-5 (with correct profile settings) sees the result as made in 2003-01-20 05:00 Member M2 on GMT+2 (with correct profile settings) sees it as 2003-01-20 12:00 Admin moves the forum to a server in GMT+0 in the meantime and sets the timezone Member M1 in GMT-5 will see it as 2003-01-20 05:00 without change Member M2 on GMT+2 will see it as 2003-01-20 12:00 without change
As far as the intServerBias goes... Wouldn't it cause wrong results then?
< |
Stop the WAR! |
 |
|
Deleted
deleted
    
4116 Posts |
Posted - 31 January 2003 : 21:43:47
|
quote: Originally posted by HuwR
3) Users are unable to control any aspect of the time displayed, it displays the forum time to everyone.
I meant "our" users, i.e. Forum Admins. If I have a server in a New York host (GMT-5) and I'm in Turkey and providing a forum to Turkish users, I set it to +7 so that posts "seem to be made" in local time...
quote:
1) The purpose of the mod was to display post times in the users own local timezone.
Yes, as a result... Is it possible to get timezone info of the clients? Non-members or members without profile settings? It could simply set a non-permanent cookie and show correct time...
quote:
2) the code uses SERVER side javascript to try to ascertain the servers offset from gmt, this caused an error on some servers with older java engines, so if it errors it defaults to zero. (some people do not know the timezone of the server, hence the attempt to do it automatically) it is needed to calculate the initial time offset for the forum.
I'm not sure if the current code does this. It is calculated when the entered data is valid. The logic should be:
If not valid_server_timezone_data_entered then
try to calculate intServerBias, if not possible set it to 0
else
get the timezone data
try to calculate intServerBias
if possible_to_calculate then
check the entered data with intServerBias and warn if no match
else
intServerBias = 0
end if
end
quote:
4) it is manual for the forum since its offsets are stored in an app variable, it could be done automatically by saving the next change date in an app variable as well, then check that against todays date before it calculates strforumtimeadjust.
I think I'll include it. It is hard to test on the other hand... Any idea on this? < |
Stop the WAR! |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 01 February 2003 : 06:04:04
|
quote:
If I'm not mistaking: If the database values were kept in UTC, a server move to another timezone, or daylight saving changes would not cause a "quantum leap" provided that the old/new timezones are kept correctly and daylight saving are calculated automatically.
A server move does not cause quantum leaps now if you set your forum up correctly.
To be honest I don't care how it is done, the timezone mod was written how it was so that it did not require any changes in the base code, since the base code still works the same way and times are still stored as they were previously.< |
 |
|
Deleted
deleted
    
4116 Posts |
Posted - 01 February 2003 : 07:05:20
|
If it realy works correctly, I'm fine with it...< |
Stop the WAR! |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 01 February 2003 : 07:24:43
|
The only thing I would do is have a manual over-ride for the code which gets intServerBias, so rather than using 0 if it can't find it, the admin can set the apropriate offset, this is the only problem I encountered, and add a var for the next daylight saving change.
changing the way time is actually stored would create enormous problems when upgrading existing forums.< |
 |
|
Deleted
deleted
    
4116 Posts |
Posted - 01 February 2003 : 07:43:50
|
quote:
changing the way time is actually stored would create enormous problems when upgrading existing forums.
This is also why I'm unwilling to do so, if it is not absolutely needed.
quote:
intServerBias
What do you say to the pseudo-code I wrote above? < |
Stop the WAR! |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 01 February 2003 : 08:08:45
|
I'm not sure I follow it, there is no point in trying to calculate intserverbias if there is no forum timezone to compare it to, it would be meaningless so it only tries to calculate it if there is a valid forum timezone.< |
 |
|
|
Topic  |
|
|
|