Microsoft KB Archive/245786

{|
 * width="100%"|

HOWTO: Convert from GMT(UTC) Time to Local Time

 * }

Q245786

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)

-

SUMMARY
While the system uses Universal Coordinated Time or UTC-based time internally, applications generally display the local time, or the date and time of day for your time zone. However, a developer occasionally may need to programmatically convert from UTC (previously referred to as Greenwich Mean time or GMT) time to local time.

This conversion can be done by using the following Win32 functions:

// Converting UTCTime to LocalTime.

FILETIME FileTime, LocalFileTime; SYSTEMTIME UTCTime, LocalTime; SystemTimeToFileTime(&UTCTIme,&FileTime); FileTimeToLocalFileTime(&FileTime, &LocalFileTime); FileTimeToSystemTime(&LocalFileTime, &LocalTime); Additional query words:

Keywords : kbNLS kbOSWinNT400 kbLocalization kbGrpDSIntl

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch