Re: Converting from GMT
- From: "leov SpamMeNot" <lviolette.SpamMeNot@xxxxxxxxxx>
- Date: Thu, 17 Nov 2005 12:13:48 -0800
If you KNOW that the time you have is UTC, you can convert it to Local time
by using the following APIs:
SystemTimeToFileTime // Convert UTC time to a FileTime format
FileTimeToLocalFileTime // Convert that FileTime to a local time using
GetTimeZoneInformation
FileTimeToSystemTime // Convert the resulting time back to SystemTime,
which you can then use to construct whatever date/time class you want.
Now, from this information, I'll give you a treat if you can tell me how to
convert from LocalTime to UTC. <g>
"Ken" <Ken@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:03CA8376-6033-4CEB-AE68-3639E2574531@xxxxxxxxxxxxxxxx
>I must be missing something as this would seem obvious, but what is the API
> call to get the current GMT offset?
>
> I have a date that is GMT. I use a COleDateTime object to format the
> date/time for the user in their preferred format. However, COleDateTime is
> ignorant of DST or GMT. However, CTime apparently deals with GMT but has
> lower resolution and is not as nice to work with for formatting.
>
> I think my preferred method would be to add/subtract the GMT offset to the
> COleDateTime object, but I'm not quite sure what API to call to get the
> offset.
>
>
.
- Prev by Date: Re: Visual C++ 2005 express edition and MFC ?
- Next by Date: Internal error.. any help?
- Previous by thread: Re: Converting from GMT
- Next by thread: What is better way to speed up drawing?
- Index(es):
Relevant Pages
|