hi Glenn,

I am working on an application geographically widely spread that makes use of 
critically sensitive time data. I need to be able to extract the time and 
timezone on the user's local machine, convert it to UTC time and then convert 
it back to some other timezone time. The time conversion at this point is not 
the issue. The only problem is how to read the user's machine timezone. But, 
thank you for prompt reply.

Emmanuel


--- In [email protected], "Glenn B. Lawler" <gblaw...@...> wrote:
>
> Emmanuel,
> 
> > Does anyone know of a free component that converts the local time to UTC
> and back to another time zone local time?
> 
> I am not sure what your application is for these converted times, or what
> time structure you are using. If you are talking about TDateTime, changing
> from one timezone to another is simply a matter of subtracting your UTC
> offset. For example, US Pacific time is -8, so you subtract -8 from the
> current time to calculate UTC time. If it is 1 AM minus -8 is 9 AM. To
> convert from UTC time to another local time, just add the offset. Since
> TDateTime is a numeric (double) type, you can just calculate the number.
> 
> If you are talking about file times, there are Windows API calls available.
> GetFileTime returns the CreationTime, LastAccessTime, and LastWriteTime for
> an open file handle. These times are UTC times, if the file system is NTFS.
> FileTimeToLocalFileTime converts a UTC file time to the local time of the
> machine.
> 
> If you tell me more about what you are trying to do with these times, I can
> tell you specifically how I would handle the situation. 
> 
> Glenn Lawler
> www.incodesystems.com
>


Reply via email to