ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sort timestamp array

In trying to sort an array of timestamps, I'm geting unusual behavior. The date order is correct, but the times are in reverse order within a given date. Is this expected bahvior? I would have thought that the internal representaion of the date is a number of seconds (since the beginning of time). As a sanity check I've also converted the timestamp to a double and sorted on that, which gives the same result

 

timestamp sorting snippet.png

 

timestamp sorting.png

 

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

Hello littlesphaeroid,

 

Based on your screen capture, the order appears to be correct - 3PM is earlier than 4PM, 12 AM is earlier than 11 AM.  Do you have a different data set that demonstrates this behavior?

 

Regards,

Tom L.
0 Kudos
Message 2 of 21
(6,718 Views)

The data seems fine. May be you are confuse becasue of DD-MM-YY positions..

 

Here only 1 function sort 1D array (as yours) and its working.

--------------------------------------------------------------------------------------------------------
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 3 of 21
(6,697 Views)

@Ranjeet_Singh wrote:

The data seems fine. May be you are confuse becasue of DD-MM-YY positions..

 

Here only 1 function sort 1D array (as yours) and its working.


 

??

 

Their screenshot shows it as MM/DD/YYYY.

0 Kudos
Message 4 of 21
(6,678 Views)

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.

--------------------------------------------------------------------------------------------------------
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 5 of 21
(6,667 Views)

Why would you go and do that?  It just adds one more complication to the question that doesn't solve the poster's problem.  Assuming that he even has a problem which still has to be confirmed.

0 Kudos
Message 6 of 21
(6,654 Views)

@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.

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 7 of 21
(6,646 Views)

I'm sorry, I think I stupidly thought that 12 AM came after 11 AM!

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 8 of 21
(6,623 Views)

@littlesphaeroid wrote:

I'm sorry, I think I stupidly thought that 12 AM came after 11 AM!


Believe me, it's not stupid... but that's why we have the 24 hour clock.  0030 obviously comes before 1130.  🙂

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 9 of 21
(6,617 Views)

@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.

--------------------------------------------------------------------------------------------------------
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 10 of 21
(6,606 Views)