date

General discussion of WarcraftRealms UI Mods
Post Reply
goatus
Posts: 5
Joined: Sun Aug 14, 2005 4:18 am

date

Post by goatus »

Quick question. In SavedVariables -> TimesPlus section Census seem to be saving population data with offset = -1 day. I wonder if its ment to be that way or this is somekind of bug?

Exaple: Purged database to make sure. Then i took census:
-Game time was 13:54 (1:56PM) Today we have 14 august 2005

In saved variables it shows
2005-08-13&13:54:00

which is exactly -24h

It isnt big problem im just wondering how exactly it works :]

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Are you on EU servers? Also, what timezone do you reside in? I do some modifying of the date based on the Server time, server locale (US or EU) and your local timezone. It is possible there is a problem with this, most likely an edge case where only at certain times is it off. If you can give me more info, it might help me to determine what I'm doing wrong.
phpbb:phpinfo()

goatus
Posts: 5
Joined: Sun Aug 14, 2005 4:18 am

Post by goatus »

gah ofcourse forgot most important info rotf. EU servers. Timezone is
GMT +1 so same as EU servers (means my local time = server time for me)

goatus
Posts: 5
Joined: Sun Aug 14, 2005 4:18 am

Post by goatus »

Found first small bug (yep im digin into code) which would also remove "unable to determine locale" message

line 1219:
CensusPlus.lua

Code: Select all

if( servDiff == 1 or servDiff == -23 ) then
CensusPlus_Msg("Guessing European (EU) Servers");
		if( g_CensusPlusLocale == "US" and g_TZWarningSent == false) then
			CensusPlus_Msg("I guessed you are playing on EURO servers but your locale is not set to EU, are you sure this is correct?  Type /census locale to change locale setting.");
			g_TZWarningSent = true;
		end
Hmm that will be hard to explain

Basicaly you don't take into account time change here in Europe. I will explain on example.

In winter(winter time so no offset to GMT):
GMT Time is lets say 8am
London time is 8am
EU (france) server time is GMT +1 which is 9am.

Ok but when time goes to summer time we have:

GMT Time is 8am
London time is GMT +summer time offset (1) so 9am
servers time is GMT time +1 +summer time so its 10am


So if( servDiff == 1 or servDiff == -23 )

won't catch it

Edit: erm whole part wrong.. should be:

Should be if( servDiff == 1 servDiff ==2)

why?

servDiff is difference between UTC and server time so in winter it is 1h and in summer 1h + summer time offset so 2h and it shouldnt be anything other for EU servers

Well thats all i found till now if i made mistake please someone correct me :P im nowhere near to be timespecialist ;]

goatus
Posts: 5
Joined: Sun Aug 14, 2005 4:18 am

Post by goatus »

Found it

Same reason as that bug with "unable to determine locale" (post above)

Line: 152
CensusPlusPvP.lua

Code: Select all

if&#40; g_CensusPlusTZOffset  < -8 &#41; then
		--  then it should only be equal to -23
		TZOffset = 1;
	&#91;u&#93;elseif&#40; g_CensusPlusTZOffset  > 1 &#41;&#91;/u&#93; then
		--  then it should only be equal to 16 - 20
		TZOffset = g_CensusPlusTZOffset - 24;
end
Should be elseif( g_CensusPlusTZOffset > 2 )

BTW i dont know if there is any need to keep that first line now ->

Code: Select all

if&#40; g_CensusPlusTZOffset  < -8 &#41; then
		--  then it should only be equal to -23
		TZOffset = 1;
Hmm hopefully i didnt mess anything ;]

goatus
Posts: 5
Joined: Sun Aug 14, 2005 4:18 am

Post by goatus »

Sht oki its 1am here and now i understand reason for -23 in that if ;] (at least i think i understand :P )

funny thing ;]

so it should be:

In CensusPlus.lua

Code: Select all

 if&#40; servDiff >= 1 and servDiff <=2&#41; or &#40;servDiff <= -22 and servDiff >=-23&#41;
and in CensusPlusPvP.lua

Code: Select all

if&#40; g_CensusPlusTZOffset ==-23 &#41; then
      --  then it should only be equal to -23
      TZOffset = 1;
   elseif&#40; g_CensusPlusTZOffset  == -22 &#41; then
      TZOffset = 2;
   elseif&#40; g_CensusPlusTZOffset  > 2 &#41; then
      --  then it should only be equal to 16 - 20
      TZOffset = g_CensusPlusTZOffset - 24;
end
hmm >.<

Edit: Crist did mistakes again... corrected... argh now it should be ok

i should stop spaming now O.o or i will create even more complicated and full of mistakes posts :P

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

Ah, kk, I wasn't really aware of the time change. I guess that's akin to Dalight Savings Time here in the states? I'll have to do some thinking to see if I can wrap my head around that.

Thanks for the input!
phpbb:phpinfo()

Post Reply