LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

end of month

Hi all,

May I know how to get the value of End of Month (EOM)?? Like for example, if I select January it will display 31, for February it will display 28 (depends on leap year) and so on... THANKS!!!
0 Kudos
Message 1 of 8
(4,215 Views)
Hi
 
This is just a combination of case-structure and a little math.
For the months January, March, May, Juli, August, October and December, the last day is the 31st.
For the months April, June, September and November, the last day is the 30th.
For February, you have to follow this rules:
1. Each year, dividable by 4 without rest is a leap year (e.g. 2004)
2. Each year, dividable by 100 is not a leap year (e.g 1900)
3. Each year, dividable by 400 is a leap year (e.g. 2000)
 
 
Thomas

Message Edited by becktho on 02-20-2006 08:05 AM

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 8
(4,207 Views)
Hello 222,

starting from LV7.0 you can use LabViews capabilities to calc dates using the timestamp control and "date/time to seconds"/"seconds to date/time" functions. LabView will check for leap years on its own...


Message Edited by GerdW on 02-20-2006 09:48 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 8
(4,200 Views)
Hello 222,

ok there was a glitch... Labview is not as smart as i thought it would be 🙂


Message Edited by GerdW on 02-20-2006 09:55 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(4,193 Views)
Thanks guys.. Appreciate that... Smiley Happy
0 Kudos
Message 5 of 8
(4,184 Views)
I have an activex control on my computer from Sheridan Calendar Widgets. It has a property node for days in month based on the current selection.
0 Kudos
Message 6 of 8
(4,152 Views)

I currently had a similar problem. I solved it with simple comparison of month part of timestamp cluster:

 

0 Kudos
Message 7 of 8
(2,779 Views)

Hi Jez,

 

so you need upto 30 iterations of this loop with upto 60 conversions from timestamp to datetime cluster for something easily done without any iterations as shown 13½ years ago?

 

And you provide your "solution" just as image of some code without handing out a snippet or VI? (Well, I didn't attach a VI at that time, too. But we didn't have snippets back then.)

Best regards,
GerdW


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