LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sort timestamp array

And for programming and background its YYYY/MM/DD but when displaying this to user we generally convert it to DD-MM-YYYY

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 11 of 21
(1,502 Views)

Number should always be written in a MSB order, regardless och which numbers it is, thus it should be YYYY/MM/DD HH:mm. Other solutions are actually misleading and stupid. How often do you hear people talking about how they're 5"6' or the time is 48:8 (although you usually say 17 past 5, but that usually refers to the hour being relatively well known, just like some people answer 81 when asked how tall they are, since the 1m is rather obvious).

 

Powerlifters have the same use of language, they lift/train at 60kg, since the 100 is redundant. 🙂 Technically it'd be '60 kg then, since it's an abbreviation.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 12 of 21
(1,487 Views)

Dates should probably not be written in a culturally ambivalent fashion. Year first is not common in any cultural context I've encountered, and obviously whether you put the month or date first depends on where you are. However, as a basic timestamp, without punctuation (eg 20131026), an 8-digit year-month-date sorts correctly. 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 13 of 21
(1,483 Views)

@littlesphaeroid wrote:

Dates should probably not be written in a culturally ambivalent fashion. Year first is not common in any cultural context I've encountered, and obviously whether you put the month or date first depends on where you are. However, as a basic timestamp, without punctuation (eg 20131026), an 8-digit year-month-date sorts correctly. 


Welcome to Europe/Sweden. Date's are always written as 131026. 🙂

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 14 of 21
(1,480 Views)

@littlesphaeroid wrote:

Dates should probably not be written in a culturally ambivalent fashion.


 

You have full control over the timestamp indicator format and sorting of timestamps is always correct.

 

As long as you don't try to sort ASCII formatted time strings (but that would be asking for trouble anyway!), you are always fine.

 

0 Kudos
Message 15 of 21
(1,476 Views)

ASCII formatted is axactly what I was referring to. If you must produce an ascii formatted timestamp, there's only one way I can think of to format it that will sort correctly.

 

As for how Sweden does it, the Göteborgs-Posten uses 26 oktober 2013. Sydsvenskan does it the same way. Which is pretty much what I expected from living in Europe. Like I said, year first is uncommon in daily life, though useful in a programming context. I think programmers need ot be aware of how dates are read and format accordingly. 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 16 of 21
(1,472 Views)

@Yamaeda wrote:

, just like some people answer 81 when asked how tall they are, since the 1m is rather obvious).

 



And that is one I've never heard at all because I've never heard heights referred to in "meters".

0 Kudos
Message 17 of 21
(1,460 Views)

@Ranjeet_Singh wrote:

@billko wrote:

@Ranjeet_Singh wrote:

Unused elements says MM-DD-YYYY(I Saw that). As it was told earlier that this is perfecly valid but we normally follow DD-MM-YYYY. Just I uploaded the VI with same format.


It depends on who "we" are.  In the USA, it is common to use MM/DD/YYYY.  If you are a programmer, you probably use YYYY/MM/DD.


No We here needs to follow DD-MM-YYYY becasuse here we are comfortable with that format only.


No disrespect intended, believe me - but that is an incredibly conceited thing to say.  There are several "standard formats" depending on where you are and what you are doing.  You definteily don't speak for all of us.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 18 of 21
(1,439 Views)

@RavensFan wrote:

@Yamaeda wrote:

, just like some people answer 81 when asked how tall they are, since the 1m is rather obvious).

 



And that is one I've never heard at all because I've never heard heights referred to in "meters".


1.68m tall here, or '68. 🙂
/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 21
(1,431 Views)

@littlesphaeroid wrote:

ASCII formatted is axactly what I was referring to. If you must produce an ascii formatted timestamp, there's only one way I can think of to format it that will sort correctly.

 

As for how Sweden does it, the Göteborgs-Posten uses 26 oktober 2013. Sydsvenskan does it the same way. Which is pretty much what I expected from living in Europe. Like I said, year first is uncommon in daily life, though useful in a programming context. I think programmers need ot be aware of how dates are read and format accordingly. 


True, they do. But if writing dates compact, as in bithdates or social security numbers, it's in the 131026-form.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 20 of 21
(1,429 Views)