LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make an array containing all the dates between two dates

Solved!
Go to solution
Basically I need a vi that returns an array with elements containing all the individual dates that exist between two dates. I am currently building one myself...but obviously if there is already some vi that does this I would rather use it. Anyways any help is appreciated...I will just be over here writing some overly complicated solution to pass the time.
0 Kudos
Message 1 of 5
(3,586 Views)

Hi electric,

 

"Anyways any help is appreciated"

 

You should have 3 inputs to your VI: data array (containing dates and data), start date, end date.

Now you need a loop. In the loop you compare the date of the current array item with start and end date. When in range, then add to output array. Hint: use a shift register to keep the output array...

 

Otherwise simply attach your own work here and someone will give hints on how to improve your work!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,579 Views)

The day of month element of the cluster converts the time correctly even if it exceeds the days in a month.

 

Also, you can simply add 86400, or 1 with the unit "d".

 

Dates.png


___________________
Try to take over the world!
0 Kudos
Message 3 of 5
(3,573 Views)
Solution
Accepted by topic author electric550

Just an idea

Output is the array of dates (as timestamps) between "Start" and "End" time stamps.

 

days.PNG

 

Marco

Message 4 of 5
(3,569 Views)
Thanks...you just saved me a ton of time...I was trying to use a formula and a bunch of other stuff. That is much easier. Thanks again!
0 Kudos
Message 5 of 5
(3,556 Views)