Re: DateTime and timezone.

From: Jerry Pisk (jerryiii_at_hotmail.com)
Date: 05/30/04


Date: Sun, 30 May 2004 00:59:03 -0700

Are you sure you're using "Mountain Standard Time" and not "US Mountain
Standard Time"? The difference between those two is that "US Mountain
Standard Time" is used in Arizona (except Navajo Nation) and doesn't observe
daylight saving time. That would explain the difference you're seeing (and
show that your code works fine :)

Jerry

"Kevin Burton" <rkevinburton@charter.net> wrote in message
news:Ox7RpJZREHA.3616@TK2MSFTNGP11.phx.gbl...
> The sequence that I am using:
>
> GetTimeZoneInformation - This returns the TIME_ZONE_INFORMATION for the
> current compter. I am in the central time zone so I see a bias of 360
> minutes (6 hours) with a daylight savings time bias of -60 (-1 hour).
> GetSystemTime - This returns the UTC current time it show a time that is 5
> hours ahead of the current time.
> Read TIME_ZONE_INFORMATION from registry - For my test I am using
"Mountain
> Standard Time" which shows a bias of 420 minutes and 0 daylight savings
> bias.
> SystemTimeToTzSpecificLocalTime - I pass the system time that I received
> from GetSystemTime and the TIME_ZONE_INFORMATION that I read from the
> registry. With no errors this functions tells me that it is 2 hours
earlier
> in the mountain time zone as opposed to the 1 hour that I was suspecting.
I
> must be calling these wrong and/or there is something with daylight
savings
> time that I am not taking into account.
>
> Thank you for your help. I will look for the P/Invoke sample.
>
> Kevin
>
>
> "Jerry Pisk" <jerryiii@hotmail.com> wrote in message
> news:OMoHlROREHA.2976@TK2MSFTNGP10.phx.gbl...
> > You should get the daylight savings time if it's in effect. I don't know
> why
> > you're getting time that's an hour off. If the original system time
> correct
> > in UTC?
> >
> > Btw there is a class to do this using P/Invoke, it's on gotdotnet I
think,
> I
> > guess I should've said that earlier...
> >
> > Jerry
> >
> > "Kevin Burton" <anonymous@discussions.microsoft.com> wrote in message
> > news:D4D66325-4521-4446-B81B-D52FB603676B@microsoft.com...
> > > You have been very helpful. I am well on my way to a good support
class.
> I
> > have chosen to use managed C++ rather than P/Invoke. It is just easier
for
> > me.
> > >
> > > One more question. The registry has entries for the standard time
zones
> > and there is a TIME_ZONE_INFORMATION struction associated with each of
the
> > standard time zones. However, if I want to get the local time in the
> > Mountain Standard Time zone (I am in Central Time Zone) I do a
> > GetSystemTime() then SystemTimeToTzSpecificLocalTime using the key value
> > from the "Mountain Standard Time" for the TIME_ZONE_INFORMATION. If I
> > calculate the difference between the current time, in CT, and MT it
comes
> > out to be 2 hours instead of 1 hour like I would expect. I am guessing
> that
> > since I passed "Mountain Standard Time" the TIME_ZONE_INFORMATION
> structure
> > that is returned is for "Mountain Standard Time" and not "Mountain
> Daylight
> > Savings Time". I see that in the structure that there are bias' for
> daylight
> > savings time and standard time. How do I detect that daylight savings
time
> > is in effect?
> > >
> > > Thanks again.
> > >
> > > Kevin
> >
> >
>
>



Relevant Pages

  • Re: Reminder Daylight Savings Time This Week-end
    ... last year, whilst New South Wales (NSW), The Australian Capital Territory ... the Northern Territory don't do daylight savings. ... being Australian Western Standard time. ...
    (rec.pets.cats.anecdotes)
  • Re: Calendar Events - Time Problem
    ... and Entourage are both set for Eastern Standard Time. ... You're making events to occur next week or later - in Daylight Savings Time ... first day of EDT when the time changes after the day begins. ... Entourage FAQ Page: ...
    (microsoft.public.mac.office.entourage)
  • Lost hour changing from daylight savings to standard time
    ... I was curious about what happens with time stamps (not the T-SQL datatype, ... but rather saving absolute time of insert/modification) during the changeover ... from daylight savings to standard time. ... once under daylight savings and a second time under ...
    (microsoft.public.sqlserver.programming)
  • Re: Determining Daylight Savings
    ... Daylight savings starts on the last Sunday in October and Standard time starts on the 1st Sunday in April so... ... Dim intLastSunday As Integer ... Dim intFirstSunday As Integer ...
    (microsoft.public.access.formscoding)
  • Re: Comparing Dates of 2 projects
    ... My clock setting is correct for Mountain ... Standard time. ... My newsreader says I posted my reply at 1:48 PM and as I ...
    (microsoft.public.project)