LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate day of week from date

Does anyone know how to generate the day of week (monday, tuesday) for a given date (i.e. Jan 01 1996)?
Unfortunately, the LabView 6's 'Date/Time to Seconds' VI requires day of week info.
0 Kudos
Message 1 of 6
(8,373 Views)
Actualy you don't realy need this value. Just use 0 for day of week. LV will automatically calculate this. See attached example.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 2 of 6
(8,373 Views)
Here is one way of getting the name of a given date. Hope this helps. /Mikael
Message 3 of 6
(8,373 Views)
additional possibility - I use it as sub.vi
regards
wha
0 Kudos
Message 4 of 6
(8,373 Views)
Probably already been answered, but extended help for this function
indicates that day of week and day of year are ignored.


"eyebe" wrote in message
news:50650000000800000002310000-1004225886000@exchange.ni.com...
> Does anyone know how to generate the day of week (monday, tuesday) for
> a given date (i.e. Jan 01 1996)?
> Unfortunately, the LabView 6's 'Date/Time to Seconds' VI requires day
> of week info.
0 Kudos
Message 5 of 6
(8,373 Views)
eyebe,

If you just want to know the current day of the week, use the LabVIEW "Get Date/Time String" function and use Long format, then parse out the day of the week. Or, an easier way would be to use the "Get Date/Time in Seconds" wired into the "Format Date/Time String" with "%A wired to the format string.

If you want either for a specific time, you will have to translate the date/time you want to seconds since 1/1/1904 and input it into either function above.

Good luck
Message 6 of 6
(8,373 Views)