Re: Converting from GMT



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.
>
>


.



Relevant Pages

  • Re: Howto convert a VB datetime til FILETIME format....
    ... > Does anybody have a snippet of code to due date conversions between visual ... > basic and the FILETIME format use in some API functions.... ...
    (microsoft.public.vb.winapi)
  • Re: script to check change in groups
    ... Dim strLastDateFile, objFSO, objDateFile ... Const ForReading = 1 ... ' Specify file where last change date (in UTC) is saved. ... The format of the whenChanged attribute is generalizedTime, ...
    (microsoft.public.windows.server.scripting)
  • Re: Convert DirectX secondary buffer contents to floating point
    ... > converting at load time is preferable. ... What API should I use to do ... Streaming is definately the way to go, it prevents wasting memory that could ... validate the format and determine it's size, locate the data chunk, and read ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: date Conversion Program in Assembly
    ... > API that will return either the Date or Time string formats. ... That's not the format. ... "specific" programming nonsense that comes back to bite you in the butt ...
    (alt.lang.asm)
  • Re: Formatting compact Flash
    ... passing the disk handle obtained using CreateFile API. ... I will try using the partition handle; I need some clarifications; To format ... Should the volume has to be unmounted before calling the FormatVolume API? ...
    (microsoft.public.windowsce.embedded)