10-24-2013 03:40 PM
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
10-24-2013 03:54 PM
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,
10-24-2013 10:21 PM - edited 10-24-2013 10:22 PM
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.
10-25-2013 03:33 AM
@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.
10-25-2013 05:17 AM
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.
10-25-2013 08:41 AM
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.
10-25-2013 09:13 AM
@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.
10-25-2013 05:29 PM
I'm sorry, I think I stupidly thought that 12 AM came after 11 AM!
10-25-2013 05:43 PM
@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. 🙂
10-25-2013 09:46 PM
@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.