LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to compare different timestamps and check which one is greater.

Solved!
Go to solution

Hi Guys,

 

I have a small question regarding datetime.

 

I have the following data in an array in timestamp format .

01:00:00.000
19-05-2009


01:00:00.000
22-05-2009


01:00:00.000
23-05-2009

 

 

What I want to do is to check which date is greater then the other.  Simply my question is how to do comparison between dates , specially when they are in time stamp format

 

Secondly I would like to ask if I have a timestamp which has the following values

 

01:00:00.000
22-05-2009

 

How do i convert it into seconds ?

 

Thankyou

 

 

0 Kudos
Message 1 of 5
(8,694 Views)

 


@OmarTariq wrote:

Hi Guys,

What I want to do is to check which date is greater then the other.  Simply my question is how to do comparison between dates , specially when they are in time stamp format


Just use a comparison function directly. The functions are polymorphic. If you don't understand what polymorphism is, then please review the LabVIEW Help and the LabVIEW tutorials, as they cover this behavior.

 

 


Secondly I would like to ask if I have a timestamp which has the following values

 

01:00:00.000
22-05-2009

 

How do i convert it into seconds ?


Just use the Numeric Conversion functions. This will give you the number of seconds number of seconds that have elapsed since 12:00 a.m., Friday, January 1, 1904, Universal Time.

 

Download All
0 Kudos
Message 2 of 5
(8,682 Views)
Solution
Accepted by topic author OmarTariq

You can build an array of time stamps and use the array min/max to compare sets of timestamps.

Use the to double conversion to get seconds since...

timeComparison.png


Paul
Message 3 of 5
(8,673 Views)

Oops, missed that we're dealing with more than 2. Yeah, if you've got more than 2 then an array is the way to go.

0 Kudos
Message 4 of 5
(8,666 Views)

Great , thats what i wanted.

 

Would like to thank both of you 😃

 

Rgs

 

Omar

0 Kudos
Message 5 of 5
(8,662 Views)