Example Code

Calculate DIN ISO 8601 conform calandar week

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example VI shows how to calulate the DIN ISO 8601 conform calandar week for any date (timestamp).

 

Description
Use the "calulate calendar week.vi" to calculate the DIN ISO 8601 conform calandar week for any date (timestamp).
This .vi calulates the Calendar week of a given timestamp according to the DIN ISO 8601 standard.
It returns the calendar week and the year of this calandar week.
It is very important to use the returned year because round New Year the year of the calendar week isn´t always the same as the year of the day in the given timestamp.You can set the "blanking leading zero" input to get the calendar week in a one-digit fromat if the calander week is below 10.

Requirements
LabVIEW 2012 (or Compatible)

Steps to Implement or Execute Code
Select Timestamp
Run the Vi

 

Additional Information or References

VI Block Diagram

Calculate calendar week LV_2012_NI_Verified.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
BetaCommunityCo
Member
Member
on

Handy

Thanks! This will be useful.