Re: Converting from GMT
- From: "AliR" <AliR@xxxxxxxxxxxxx>
- Date: Tue, 08 Nov 2005 19:18:05 GMT
You can call GetTimeZoneInformation(...) to get the difference between local
time and UTC (GMT)
or you can use CTime so you can get the difference
CTime time(CTime::GetCurrentTime());
tm t1 = *(time.GetLocalTm());
tm t2 = *(time.GetGmtTm());
TRACE("Difference between local time and GMT is %d hours.\n",
t1.tm_hour - t2.tm_hour);
AliR.
"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: Efficiency of Returning Object
- Next by Date: Re: what is the maximum data for double value?
- Previous by thread: Re: Bitmap resource with more than 256 colors
- Next by thread: Re: Converting from GMT
- Index(es):
Relevant Pages
|