LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find 2nd Thursday of every month

Solved!
Go to solution

I am trying to work out how to create a program that gives the user a popup saying 'windows needs an update' every 2nd Thursday of the month. The pop up needs to occur at midnight when the 2nd Thursday of the month first starts.

 

Would anyone be able to help I am not to sure where to start.

 

Thank you 

Hraym

0 Kudos
Message 1 of 5
(552 Views)
Solution
Accepted by topic author hraym2004

Hi hraym,

 


@hraym2004 wrote:

The pop up needs to occur at midnight when the 2nd Thursday of the month first starts.


Determine the "day of week" of the 1st day of the month using the DateTime ToSeconds/FromSeconds functions. Once you know the "day of week" of the 1st you can easily determine the 2nd Thursday of the month by simple math...

 

Suggestion to start:

Best regards,
GerdW


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

Thank you for your help 

0 Kudos
Message 3 of 5
(516 Views)

I am looking at doing the maths. 

 

Would you make an offset for each day of the week and then code that into labview?

 

Kind regards

Hraym

0 Kudos
Message 4 of 5
(481 Views)

Hi hraym,

 


@hraym2004 wrote:

Would you make an offset for each day of the week and then code that into labview?


Examples:

day of week = 1 -> 2nd Thursday = 12

...

day of week = 5 -> 2nd Thursday = 8

day of week = 6 -> 2nd Thursday = 14

day of week = 7 -> 2nd Thursday = 13

You can create a simple lookup table or implement some math (including one Modulo operation)...

 

(With a sheet of paper and a pencil this should be an easy task!)

Best regards,
GerdW


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