01-29-2013 09:37 AM
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
01-29-2013 10:50 AM - edited 01-29-2013 10:50 AM
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.