tags:

views:

137

answers:

1

UK is currently 1 hour ahead of UTC due to Daylight Savings Time. When I check the Daylight Bias value from GetTimeZoneInformation it is currently -60. Does that mean that translating UTC to DST means DST = UTC + -1 * DaylightBias, ie negate and add?

I thought in this case for instance adding Daylight Bias to UTC is the correct operation, hence requiring DaylightBias to be 60 rather than -60.

A: 

No, it's

DST = UTC + DaylightBias [for your specific timezone]

here's a quote from the MS glossary:

time zone bias: The positive, zero, or negative offset in minutes from Coordinated Universal Time (UTC). For example, Middle European Time (MET, GMT+01:00) has a time zone bias of "-60" because it is one hour ahead of UTC. Pacific Standard Time (PST, GMT-08:00) has a time zone bias of "+480" because it is eight hours behind UTC.

Lance Roberts
My problem is that the GetTimeZoneInformation is currently returning a value of -60, which would put DST an hour behind, instead of being ahead, which is why I am not so sure.
vfclists
@vfclists, you may be either thinking of ahead differently or using the opposite reference. My take on "ahead" is as they define it in the time zone bias glossary excerpt. Look carefully at how they do that. They use one hour ahead as the example, i.e. MET. Are you in MET?
Lance Roberts
I think I am probably confused about the terminology, because I expect DST to be what a person in the time zone would read from his clock.In the UK at this time the clock reading is an hour ahead of Morocco or Ghana, which don't use DST. Applying the formula DST=UTC + (-60) would result in a clock reading an hour behind.I will check my code again
vfclists
@vfclists, the offset is based on the timezone of application referenced to GMT (UK time). So, if you're in the UK, you take UTC value and add the Daylight Bias value of -60 to get your actual time. If you were in Morocco your Daylight Bias value would be 0, giving you UTC time as your local time (as you've said, though actually right now Morocco is +1 hr from UTC, http://www.timeanddate.com/worldclock/city.html?n=60).
Lance Roberts
@Lance, I thought UTC is the same as GMT in a zone with no DST, say Accra. Morocco uses DST so I will focus on Accra alone which is a few miles from the Greenwich Meridian.At this time Accra clocks are an hour behind UK, so taking UTC to be Accra clock time, say 10:00am, DST in the UK being UTC + DaylightBias would be 10:00+(-60) =09:00, which would put it 2 hrs behind the UK clock.For me the issue is whether computer software calculates UTC as Accra clock time, ie strict GMT at any time of the year in any timezone, or UK clock time which is adjusted for DST at some times of the year.
vfclists