|
|
Register •
FAQ
• Search • Login
|
|
Page 1 of 1
|
[ 7 posts ] |
|
RFC Changing the time of an update to ignore timezones.
| Author |
Message |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
 RFC Changing the time of an update to ignore timezones.
Currently the sector/Port fields Updated are set to the users local time which will cause problems if we decide to sync databases.
I am going to throw out a couple of ideas and want some feedback as I don't want to just change things willy-nilly
There are 2 real options I see
Using the server time. If you use CT you get a date that is 12 years off. i.e 06:57:47 AM Sat Dec 18, 2021 as opposed to Today Fri Dec 18, 2009.
Using Zulu time. (for the non military perps here, also known as GMT or UTC) It is Universal it doesn't have the steenking problem of Daylight Saving Time 2 or more times a year. It is easy to use; there are built in functions to use it in Delphi/Windows/Linux/Mac OS.
The only Con I see to using it is the extra difficulty and it will break backward compatibility as older databases will still save in local time.
Comments, flames are welcome but please redirect smack to the appropriate forum.
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Fri Dec 18, 2009 8:17 am |
|
 |
|
NjoY
Ensign
Joined: Mon Jul 23, 2007 6:20 pm Posts: 288 Location: United Kingdom
|
 Re: RFC Changing the time of an update to ignore timezones.
There must be a good reason for you not being able to subtract 12 years from T. So i vote for GMT. (i'm in it too, so easier dns me. heh) But does it really matter if we are ALL 21 years in front?
_________________ Gul D'Tek (The Cardassian Hitman) ICQ - 446445340
I'm a TW and #SD# ing you was my idea!
Very funny, Scotty. Now beam down my clothes.~ J.T.Kirk
|
| Fri Dec 18, 2009 1:02 pm |
|
 |
|
the reverend
Gameop
Joined: Thu Mar 08, 2001 3:00 am Posts: 886 Location: USA
|
 Re: RFC Changing the time of an update to ignore timezones.
the right way is to use UTC time (GMT/ZULU).
_________________ twgs : telnet://twgs.thereverend.org:5023 web : http://www.thereverend.org games : http://www.thestardock.com/twgssearch/i ... verend.org helper : http://svn.thereverend.org:8080/revhelper/
|
| Fri Dec 18, 2009 3:28 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
 Re: RFC Changing the time of an update to ignore timezones.
The correct way is UTC. It's the universal standard for coordinating time zones, why break that when someone might need to coordinate across helpers as well?
We can still remain compatible with local and server times by calculating the offset. Since the local offset will be required for doing the UTC work, you might want to store it as a variable just in case someone needs it. Might also want to store the current UTC time as part of the time command too.
For local server time we'll just keep doing it the way we've been doing it, check ct, calculate results. It's actually not exactly 12 years, there's both a day and a timezone difference too.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Fri Dec 18, 2009 3:53 pm |
|
 |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
 Re: RFC Changing the time of an update to ignore timezones.
the right way is to use UTC time (GMT/ZULU).
From the discussion it looks like UTC wins so UTC it is.
And to add to this discussion I was wrong about the built in Delphi function.... I had to roll my own Thankfully there was the TTimeZoneInformation record and GetTimeZoneInformation function
So at present I'm not changing anything in the database I am just calculating Zulu time.
Here is the actual function(s) I'm using can someone point out if there is anything obviously wrong? function ConvertToUTC(val : TDateTime) : TDateTime; begin // Will Incrementing the Hour work correctly East of GMT Result:=DateUtils.IncHour(val,GetTimeZoneBias); end; function GetTimeZoneBias : integer; var TimeZone : TTimeZoneInformation; begin GetTimeZoneInformation(TimeZone); Result := TimeZone.Bias div 60; end;
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Fri Dec 18, 2009 5:30 pm |
|
 |
|
Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA
|
 Re: RFC Changing the time of an update to ignore timezones.
How is the TimeZone calculated, from the main clock?
Is .bias in minutes? If so, does it ever return partial hours?
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com
|
| Fri Dec 18, 2009 6:10 pm |
|
 |
|
Maniac
Lieutenant J.G.
Joined: Sun Mar 13, 2005 3:00 am Posts: 387 Location: USA
|
 Re: RFC Changing the time of an update to ignore timezones.
AFAICT
GetTimeZoneInformation is a windows function in Kernel32
The Docs say that bias is in minutes and the formula for UTC is UTC = local time + bias
_________________ Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
|
| Fri Dec 18, 2009 7:59 pm |
|
 |
|
|
Page 1 of 1
|
[ 7 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 7 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|