Open rip747 opened 14 years ago
Comment by brannon.hightower (Brannon Hightower) : 03/03/09 10:00 AM Thought the Time change was at 2AM. Well regardless you dont need to hard code the miliseconds like here
if you add to the code: <cfset var startDate = createDateTime(year(arguments.thisDate),month(arguments.thisDate),day(arguments.thisDate),'00','00','00')> <cfset var tMil = dateDiff("s",startDate,arguments.thisDate) * 1000>
and change the cfreturn to this:
<cfreturn timezone.getOffset(1, tYear, tMonth, tDay, tDOW, tMil) / 3600000> that should do the trick
Was this change merged in? Unfortunately, here in the comments, GitHub is not displaying the example code, not even in source.
The getTZOffset function returns invalid data if you are returning the offset for the same day that the time changed (like today, nov 2, 2008)
This is because on line 123 when getOffset() is called the last param is set to '0' when infact it should be set to '3600000' since time does not officially change on that day until 1AM.
So to fix it line 123 should read: <cfreturn timezone.getOffset(1, tYear, tMonth, tDay, tDOW, 3600000) / 3600000>
Hope this helps someone else, I was pulling my hair out over it today.