キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/21
6,153件の閲覧回数

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 件の賞賛
メッセージ2/21
6,151件の閲覧回数

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 件の賞賛
メッセージ3/21
6,130件の閲覧回数

@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 件の賞賛
メッセージ4/21
6,111件の閲覧回数

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 件の賞賛
メッセージ5/21
6,100件の閲覧回数

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 件の賞賛
メッセージ6/21
6,087件の閲覧回数

@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 件の賞賛
メッセージ7/21
6,079件の閲覧回数

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

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 件の賞賛
メッセージ8/21
6,056件の閲覧回数

@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 件の賞賛
メッセージ9/21
6,050件の閲覧回数

@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 件の賞賛
メッセージ10/21
6,039件の閲覧回数