Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How To Convert from GMT(UTC) Time to Local Time


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);

↑ Back to the top


Keywords: kbdsxglobal2003swept, kbhowto, kblocalization, kbnls, kb

↑ Back to the top

Article Info
Article ID : 245786
Revision : 1
Created on : 1/7/2017
Published on : 6/19/2014
Exists online : False
Views : 150