Wednesday, December 03, 2008 ..:: Forums ::.. Register  Login
 Forums Minimize
SearchForum Home
     
  Mainstream Forums  Developers  Daylight Saving...
 Daylight Savings SOuthern Hemisphere
 
KillerKiwi
33 posts
Joined
2/12/2007

Daylight Savings SOuthern Hemisphere
Posted: 19 Mar 08 8:25 PM Modified By KillerKiwi  on 3/19/2008 8:31:07 PM)
I can remember if I brought this up before....

We had issues with the Outlook sync when we were trialling splendid last year when daylight savings hit.
Looking at the code IsDaylightSavings it seems to make some faulty assumptions about the day light saving period starting and ending within a year

Here in New Zealand (GMT - 12 hours) our standard month is 3 and our daylight month is 10 with a bias of -60
So day light savings is from October to February NOT February to October

Testing using current code:
Current Time : 1:07:15 PM
Server Time : 1:07:15 AM
Universal Time : 1:07:15 AM - WRONG
IsDaylightSavings : False - WRONG

TimeZone : (GMT+12:00) Auckland, Wellington - Correct

Anybody else noticed this behaviour? It dosn't seem to effect the server as its in the same timezone, I guess it must only causes issue when converting to gmt and back again

Adding this to IsDaylightSavings fixs the is daylight savings issue
            // Switch if daylight month is before standard because that indicates southern hemisphere
            if(m_nDAYLIGHT_MONTH > m_nSTANDARD_MONTH){
                bDaylightSavings = !bDaylightSavings;
            }

But then my test gives :
Current Time : 1:09:44 PM
Server Time : 12:09:44 AM - WRONG
Universal Time : 12:09:44 AM
IsDaylightSavings : True
TimeZone : (GMT+12:00) Auckland, Wellington

Im not sure about where to go from here any body with more experience with this code able to help?

Thanks

Test Code
SplendidCRM.TimeZone tz = SplendidCRM.TimeZone.CreateTimeZone(new Guid("51962774-7c14-467e-8786-9bc88ade8949"));
DateTime now = DateTime.Now;
Response.Write("Current Time : " + now.ToLongTimeString() + "<br>");
Response.Write("Server Time : " + tz.ToServerTime(now).ToLongTimeString() + "<br>");
Response.Write("Universal Time : " + tz.ToUniversalTime(now).ToLongTimeString() + "<br>");
Response.Write("IsDaylightSavings : " + tz.IsDaylightSavings(now).ToString() + "<br>");

NZ Time - http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Services-Daylight-Saving-Index

"This one's tricky. You have to use imaginary numbers, like eleventeen..." - Calvin
spacecowboy
176 posts
5th
Joined
11/21/2007

Re: Daylight Savings SOuthern Hemisphere
Posted: 20 Mar 08 5:22 AM

Hey if you can save any daylight can you send it our way?

London could do with some ;-)

  Mainstream Forums  Developers  Daylight Saving...

Forum Home  Search       

Copyright (c) 2006-2008 SplendidCRM Software, Inc. All Rights Reserved.   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2008 by Perpetual Motion Interactive Systems Inc.