Do you have the [short] time for this? Part #1: The intro

by Michael S. Kaplan, published on 2012/09/13 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2012/09/13/10348936.aspx


Once upon a time, there were two Win32 functions:

This is how the Windows Shell would decide how to display the time in its clock.

Every locale had a default time format, and a list of potential other time formats they could choose instead.

There was no "short time" format. There was just a "time" format that you could pass a flag to modify if you wanted.

Things worked okay.

And then .NET and its DateTimeFormatInfo came,

As .NET was largely meant to replace VB and VBA, it included a LongTimePattern and a ShortTimePattern and actively avoided the notion of "one time format and modification by flags" stuff.

Suddenly everyone started hating that there was no "short time".

And then, starting with .NET 2.0, we had custom cultures.

They became custom locales in Vista and beyond.

And the meaning of TIME_NOSECONDS was retconed to being "use the short time format" now they had a short time to look at:

So now we are where we are.

The old way of doing it is left to the curiosity of SD logs, and the retcon has been achieved.

But clearly there must be a problem, or I wouldn't be writing a blog or blogs about it.

For the problem, you'll have to wait until tomorrow!


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2012/09/17 Do you have the [short] time for this? Part 3: What a tangled we weave...

2012/09/14 Do you have the [short] time for this? Part #2: How does it feel to be out of sync?

go to newer or older post, or back to index or month or day