LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"How to generate the week number in LabVIEW 6i"

Hi everybody, I am building a path that contains this information as part of it.
0 Kudos
Message 1 of 5
(3,282 Views)
I am going to make some assumptions, as you didn't provide quite enough information for a proper answer.

I'm assuming that you want an integer returned that represents the number of the week of the year from 1 to 52.

Actually, I didn't even know it, but this is an easy one. I have quoted the help file for the date/time codes for the function "format date/time string".

%U week number of the year (00 - 53), with the first Sunday as the first day of week one

So, if you add "%U" to your format string, you can get the week number.

That should do it for you. Let me know if you have any trouble using the function.
0 Kudos
Message 2 of 5
(3,282 Views)
Unfortunately neither the option %U nor %W (where Monday is the first day) give the correct, legal, week number for Germany. I don't know about the rest of Europe, but here the week that has the first THURSDAY of the year is week 1.

Gabi
7.1 -- 2013
CLA
0 Kudos
Message 3 of 5
(3,282 Views)
May be this is what you are looking for :

http://www.air.nl/nlibrary/weeknum_vi.html
Message 4 of 5
(3,282 Views)
I don't know if the post above answered your question, but it sounds like you are dealing with a regional issue.

I would suggest that you just take the day of the week and the week number, and put together some simple logic to allow you to get the correct number for your region.

Since I don't quite understand how you guys calculate the week number, I can't really offer too much in the way of an answer to the logic. Just use a logic table to help you.
0 Kudos
Message 5 of 5
(3,282 Views)