Jump to content

What are the most common date formatters?


Recommended Posts

DEC-12-2012 and 12-DEC-2012

Lots of Eastern Europe uses 12-XII-2012 or XII-12-2012, where the months are Roman numerals, which has the nice property of being language independent AND distinguishing the day from the month so order isn't ambiguous. I really like this one.

And there's always

December 12, 2012

Two digit years are rare these days, but depending upon your users, you might care.

Link to comment

Lots of Eastern Europe uses 12-XII-2012 or XII-12-2012, where the months are Roman numerals, which has the nice property of being language independent AND distinguishing the day from the month so order isn't ambiguous. I really like this one.

I've never seen that before, but it's rather clever. I like it.

Link to comment
  • %Y-%m-%dT%H:%M:%S
  • 2012-10-02T17:16:03

I most-often use something similar, but with decimal places for the seconds

  • %Y-%m-%dT%H:%M:%S%5u

  • 2012-10-23T17:16:03.12345

Lots of Eastern Europe uses 12-XII-2012 or XII-12-2012, where the months are Roman numerals...

Replace "Eastern Europe" with "Not North-Amreican" :)

For such dates, I usually use 12XII2012 (always have the day number 2 digits, month 3 letters, year 4 digits, so the hyphens are a waste bits).

Link to comment

As a U.S. LabVIEW for Windows user, I most often see people use the the Format Date/Time String function with no input for default string (default is %c or locale specific). The Default locale info on Windows with a setting of English (United States) looks like this:

10/5/2012 1:10:42 PM

The equivalent LabVIEW string would be

%<%m/%d/%Y %I:%M:%S %p>T

In LabVIEW 8.6, the string I provided always includes two digits for the day, month and hours, yet the default output Format Date/Time String with the default %c returns two digits only when > 9.

10/5/2012 1:10:42 PM

10/05/2012 01:10:42 PM

Link to comment

Lots of Eastern Europe uses 12-XII-2012 or XII-12-2012, where the months are Roman numerals, which has the nice property of being language independent AND distinguishing the day from the month so order isn't ambiguous. I really like this one.

I'm from Europe (And have been to eastern europe) and I would have to say that I've never seen this formatting before. Can NI output this with standard formatters?

Shane

Link to comment

Lots of Eastern Europe uses 12-XII-2012 or XII-12-2012, where the months are Roman numerals, which has the nice property of being language independent AND distinguishing the day from the month so order isn't ambiguous. I really like this one.

I'm from Europe (And have been to eastern europe) and I would have to say that I've never seen this formatting before. Can NI output this with standard formatters?

As a citizen of country frequently considered as Eastern Europe (being in fact Central Europe), I can say that we very often use this format in handwriting, but I have never seen it in any application...

Link to comment

I'm very disappointed you didn't say "%^<%Y-%m-%dT%H:%M:%S%3uZ>T" :rolleyes:

/J

Well, the original question was "What are the most common date formatters?" not the most useful date formatter. :P

Maybe someone else here could chime in regarding Oracle, but I just spent the last three hours querying and dumping results using Oracle Apps and the date/time format was:

09-OCT-2012 08:59:28

which works out to

%<%d-%b-%Y %H:%M:%S>T

except for the capitalization. I'm guessing that the month name is localized to the default language setting for the profile of the user...

  • Like 1
Link to comment

Regarding the Roman numeral month...

A) No, I don't think NI has any way to do it with the standard formatters.

B) I've seen it on lots of buildings for things like memorial markers (Serbia, Czech Republic) and I saw it on my ticket stub in Ukraine (Kiev), which was computer printed. The other examples I've seen were all handwritten.

Link to comment
  • 2 weeks later...

The thing to be careful is not use characters that operating systems don't like i.e. "/" I use this to create a data/time stamp for a file name. This guarantees a unique file name

How do you make sure this will never run more than once a minute?

(allright I have a simular one, that adds seconds, and I never make sure it runs just ones a second).

Ton

Link to comment
How do you make sure this will never run more than once a minute?
The usual solution is to have a sequence counter in your application that increments while the app is running and the sequence number is appended to the end of the file name so that names are unique within a minute/second/whatever. If you need something that is unique globally (i.e. multiple machines generating files simultaneously that may then be shared with each other), adding a random number of sufficient length to the end is the generally accepted solution, provided you use something for your random number seed *other* than the clock. :-)
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.