LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Date Programming

October has 5 Saturdays (3, 10, 17, 24 and 31).  I have been trying to get a program to identify the closest Saturday PASSED, closest to the date selected.  Example: Say I were to pick the 8th on a date Control VI.  I need the program to identify the 3rd as being the closest passed saturday to the date selected.  How do I do this programmatically?

0 Kudos
Message 1 of 3
(2,613 Views)

Hi mattyk,

 

get the weekday from the picked day and go back the number of days accordingly (like if it's a Friday then go back 6 days)...

You know how to get the weekday of a given date? If not read the context help for the functions of the time palette!

Best regards,
GerdW


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

Filthy trick, Get the week number from the with the string formatter and subtract 1, feed this to a format into string with a 7 as 'week of day' number.

 

 Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 3
(2,608 Views)