Browse by Tags

Browse by Tags
  • Blog Post: Converting from a UTC-based SYSTEMTIME directly to a local-time-based SYSTEMTIME

    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...
  • Blog Post: On the various ways of getting the current time and date in Win32

    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 Get­System­Time­As­File­Time . This returns the current time in UTC in the form of a FILE­TIME structure. This also happens to be the time...
  • Blog Post: Why do Explorer and the command prompt interpret file times differently?

    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 DIR 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...
  • Blog Post: How do I parse a string into a FILETIME?

    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 SYSTEMTIME into a string , but it does not provide...
  • Blog Post: To some people, time zones are just a fancy way of sounding important

    As I noted some time ago, there is a standard series of announcements that are sent out when a server is undergoing planned ( or unplanned ) maintenance. And since these are official announcements, the authors want to sound official. One way of sounding official is to give the times during which...
  • Blog Post: How do I generate a unique 32-bit value for a time zone?

    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 TIME_ ZONE_ INFORMATION structures, I would like to compute...
  • Blog Post: Why does my TIME_ZONE_INFORMATION have the wrong DST cutover date?

    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 GetTimeZoneInformationForYear function...
  • Blog Post: Why does the Win32 Time service require the date to be correct before it will set the time?

    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...
  • Blog Post: Why does the OLE variant date format use 30 December 1899 as its zero point?

    In 2006, via the suggestion box, Chris J asks why the OLE variant date format has such a strange zero point . Its zero point is 30 December 1899, as opposed to 1 January 1900 (SQL Server's zero point) or 1 January 1970 (the unix zero point). It turns out I don't have to answer this because Eric...
  • Blog Post: What is the format for FirstInstallDateTime on Windows 95?

    Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. Windows 98/98/Me recorded the date and time at which Setup was run in the registry under HKEY_LOCAL_MACHINE\ Software\ Microsoft\ Windows\ CurrentVersion as a binary value named FirstInstallDateTime...
  • Blog Post: Why is the Win32 epoch January 1, 1601?

    Public Service Announcement: This weekend marks the start of Daylight Saving Time in most parts of the United States. The FILETIME structure records time in the form of 100-nanosecond intervals since January 1, 1601. Why was that date chosen? The Gregorian calendar operates on a 400-year cycle...
  • Blog Post: Working with ambiguous and invalid points in time in managed code

    Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend. I pointed out some time ago that Win32 and .NET deal with daylight saving time differently. Specifically, Win32 always deals with the time zone you are currently in (even if it's not the time...
  • Blog Post: Why can't I convert a time zone abbreviation into a time zone?

    Public Service Announcement Daylight Savings Time begins this weekend in most parts of the United States. Suppose you have a string of the form "Thu Mar 27 03:46:20 CST 2003" . How can you parse this into something your program can manipulate, like say a SYSTEMTIME or a FILETIME ? Basically...
  • Blog Post: Staying on top of things with timely updates in separator pages

    Public Service Announcement This weekend marks the end of Daylight Saving Time in most parts of the United States, the first "return to standard time" cutoff under the new transition rules. For a month prior to the transition this past spring, the separator pages generated by the shared company...
  • Blog Post: Don't be so fast to discount those oddball time zones

    This weekend marks the beginning of Daylight Saving Time in most parts of the United States, the first year under the new transition rules in the Energy Policy Act of 2005 . Pay extra attention to your clocks this weekend. If you have a device that automatically adjusts for Daylight Saving Time, and...
  • Blog Post: The great Polish Sea -or- We forgot Poland!

    Open up the Date and Time control panel and go to the Time Zones tab. Notice anything wrong with the world map? Take a close look at northern Europe. Depending on what version of Windows you have, you might see a body of water where Poland should be. Windows 95 didn't have this problem , but ...
  • Blog Post: How to recognize different types of sentinel timestamps from quite a long way away

    Some time ago, I discussed several timestamp formats you might run into . Today we'll take a logical step from that information and develop a list of special values you might encounter. Note that if you apply time zone adjustments, the actual timestamp may shift by up to a day. Date Interpretation...
  • Blog Post: Why can't you treat a FILETIME as an __int64?

    The FILETIME structure represents a 64-bit value in two parts: typedef struct _FILETIME { DWORD dwLowDateTime; DWORD dwHighDateTime; } FILETIME, *PFILETIME; You may be tempted to take the entire FILETIME structure and access it directly as if it were an __int64 . After all, its memory layout...
  • Blog Post: Why do timestamps change when I copy files to a floppy?

    Floppy disks use the FAT filesystem, as do DOS-based and Windows 95-based operating systems. On the other hand, Windows NT-based systems (Windows 2000, XP, 2003, ...) tend to use the NTFS filesystem. (Although you can format a drive as FAT on Windows NT-based systems, it is not the default option...
  • Blog Post: Why Daylight Savings Time is nonintuitive

    Welcome Knowledge Base article 932955 readers! Remember, the information on this Web site is not official Microsoft documentation. Daylight Savings Time ends this weekend in most of North America and Europe, so it seems a good time to discuss the whole problem of Daylight Savings Time and timestamps...
  • Blog Post: Why isn't my time zone highlighted on the world map?

    In the original release of Windows 95, you could change your time zone by clicking on the map, and the time zone you selected would highlight. Similarly, you could change your Region Settings by clicking on the world map. This was one of those little touches that made Windows 95 that much more fun...
Page 1 of 1 (21 items)