Showing results for Time - The Old New Thing

Mar 7, 2014
0
0

Converting from a UTC-based SYSTEMTIME directly to a local-time-based SYSTEMTIME

Raymond Chen
Raymond Chen

Last year, I presented this commutative diagram A 2-by-2 grid of boxes. The top row is labeled FILE­TIME; the bottom row is labeled SYSTEM­TIME. The first column is labeled UTC; the second column is labeled Local. The upper left box is labeled Get­System­Time­As­File­Time. There is an outgoing arrow to th...

CodeTime
Nov 1, 2013
0
0

On the various ways of getting the current time and date in Win32

Raymond Chen
Raymond Chen

There are a number of functions in Win32 that obtain the current date and time. Here's how they fit together: The starting point is . This returns the current time in UTC in the form of a structure. This also happens to be the time format used internally by the system, so this value can be retrieved with a minimum of fuss. You can also call ...

CodeTime
Mar 8, 2013
0
0

Why do Explorer and the command prompt interpret file times differently?

Raymond Chen
Raymond Chen

A customer observed that if they use Explorer to view the timestamp on a file, it is not always in agreement with the value shown if they run a plain in a command prompt. They are sometimes off by an hour. Why is that? Whenever you hear the phrase "off by an hour" you should immediately think "Daylight Saving Time". The formatting of file tim...

Tips/SupportTime
Nov 2, 2012
0
0

How do I parse a string into a FILETIME?

Raymond Chen
Raymond Chen

Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. Other parts of the world may change on a different day from the United States. The NLS functions in Win32 provide functions to convert a into a string, but it does not provide any functions to perform the reverse conversion. Here are few t...

CodeTime
Nov 4, 2011
0
0

How do I generate a unique 32-bit value for a time zone?

Raymond Chen
Raymond Chen

Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. Other parts of the world may change on a different day from the United States. A customer asked the following question: Given two structures, I would like to compute a for each that I can then compare to determine whether they represent t...

CodeTime
Mar 11, 2011
0
0

Why does my TIME_ZONE_INFORMATION have the wrong DST cutover date?

Raymond Chen
Raymond Chen

Public Service Announcement: Daylight Saving Time begins in most parts of the United States this weekend. Other parts of the world may change on a different day from the United States. A customer reported that they were getting incorrect values from the function. I have a program that calls , and it looks like it's returning incorrect DST trans...

CodeTime
Nov 5, 2010
0
0

Why does the Win32 Time service require the date to be correct before it will set the time?

Raymond Chen
Raymond Chen

Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. Andy points out that if you attempt to synchronize your clock when the date is set incorrectly, the operation fails with the error message "An error occurred while Windows was synchronizing with time.windows.com. For security reasons, Windows ca...

Tips/SupportTime