Ton Plomp Posted October 5, 2012 Report Share Posted October 5, 2012 For some parsing tool I am thinking about 'Error try' to parse date strings. I am looking for the most common date formatter strings. Pleas add yours: %Y-%m-%dT%H:%M:%S2012-10-02T17:16:03 Quote Link to comment
shoneill Posted October 5, 2012 Report Share Posted October 5, 2012 %H:%M:%S %d.%m.%Y Quote Link to comment
Aristos Queue Posted October 5, 2012 Report Share Posted October 5, 2012 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. Quote Link to comment
asbo Posted October 5, 2012 Report Share Posted October 5, 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. I've never seen that before, but it's rather clever. I like it. Quote Link to comment
crelf Posted October 5, 2012 Report Share Posted October 5, 2012 %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). Quote Link to comment
Phillip Brooks Posted October 5, 2012 Report Share Posted October 5, 2012 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 Quote Link to comment
Antoine Chalons Posted October 6, 2012 Report Share Posted October 6, 2012 (edited) Our default is : %<%Y%m%d_%Hh%Mm%S>T most of our customers have no specific requirements about that and would accept anything we offer, we never needed sub-second in our applications. Only once someone asked for week number. Edited October 6, 2012 by Antoine Châlons Quote Link to comment
shoneill Posted October 8, 2012 Report Share Posted October 8, 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. 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 Quote Link to comment
Antoine Chalons Posted October 8, 2012 Report Share Posted October 8, 2012 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 I've seen this in Italy, nowhere else. Quote Link to comment
vugie Posted October 9, 2012 Report Share Posted October 9, 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. 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... Quote Link to comment
Mellroth Posted October 9, 2012 Report Share Posted October 9, 2012 ... The equivalent LabVIEW string would be %<%m/%d/%Y %I:%M:%S %p>T ... I'm very disappointed you didn't say "%^<%Y-%m-%dT%H:%M:%S%3uZ>T" /J 2 Quote Link to comment
Phillip Brooks Posted October 9, 2012 Report Share Posted October 9, 2012 I'm very disappointed you didn't say "%^<%Y-%m-%dT%H:%M:%S%3uZ>T" /J Well, the original question was "What are the most common date formatters?" not the most useful date formatter. 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... 1 Quote Link to comment
Aristos Queue Posted October 12, 2012 Report Share Posted October 12, 2012 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. Quote Link to comment
lavezza Posted October 22, 2012 Report Share Posted October 22, 2012 %^<%j/ %H:%M:%S>T[/CODE][CODE]%^<%j:%H:%M:%S>T[/CODE]287/ 23:15:42287:23:15:42Day of year, 24hr UTC. It is how things are scheduled on the International Space Station, TDRSS satellites, etc.I think files usually use the second format, displays use the first. Quote Link to comment
Phillip Brooks Posted October 24, 2012 Report Share Posted October 24, 2012 Just found this while waiting for a test to run (had some spare time to read about time) http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time Quote Link to comment
ASTDan Posted October 24, 2012 Report Share Posted October 24, 2012 (edited) Here is mine. 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 Edited October 24, 2012 by ASTDan Quote Link to comment
Ton Plomp Posted October 24, 2012 Author Report Share Posted October 24, 2012 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 Quote Link to comment
Aristos Queue Posted October 30, 2012 Report Share Posted October 30, 2012 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. :-) Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.