LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ISO8601 date standard in LabWINDOWS CVI 2012

My problem:

function FormatDateTimeString returns different calendar week than ISO8601 standard (one week less for 2013)

 

Questions:

1. what standard do CVI's time related functions from User Interface Library follow?

2. can this standard be changed to ISO8601 through a function call/setting?

3. is there another solution instead of writing a ISO8601 week number conversion function?

 

Example:

#define DATETIME_FORMATSTRING "%m-%d-%Y cw%W %H:%M"  	

//get current date-time-day	dateTimeBuffer example "10-19-2010 cw42 19:56" 
GetCurrentDateTime (&currDateTime);
bufferLen = FormatDateTimeString (currDateTime, DATETIME_FORMATSTRING, NULL, 0);
dateTimeBuffer = malloc (bufferLen + 1);
FormatDateTimeString (currDateTime, DATETIME_FORMATSTRING, dateTimeBuffer, bufferLen + 1 );
//will return calendar week 04 in dateTimeBuffer for 29.01.2013, but actually it's calendar week 05 in Europe
0 Kudos
Message 1 of 2
(2,954 Views)

Hello Ioachim,

I don't know which standard are using CVI date functions, but having already noted that difference I have published here a function to calculate week according to that standard. Feel free to examine it and reuse in your programs.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,946 Views)