User Tools

Site Tools


finding_20the_20iso_20week_20number

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

finding_20the_20iso_20week_20number [2018/03/31 13:19]
127.0.0.1 external edit
finding_20the_20iso_20week_20number [2018/04/15 10:33] (current)
richardrussell Added syntax highlighting
Line 1: Line 1:
 =====Finding the ISO week number===== =====Finding the ISO week number=====
  
-//by Richard Russell, November 2015//\\ \\  The code listed below finds the [[https://​en.wikipedia.org/​wiki/​ISO_week_date|ISO week number]] (or year and week) corresponding to a given date:\\ \\ +//by Richard Russell, November 2015//\\ \\  The code listed below finds the [[https://​en.wikipedia.org/​wiki/​ISO_week_date|ISO week number]] (or year and week) corresponding to a given date: 
 + 
 +<code bb4w>
         INSTALL @lib$+"​DATELIB"​         INSTALL @lib$+"​DATELIB"​
  
Line 41: Line 43:
         IF dow% = 0 dow% = 7         IF dow% = 0 dow% = 7
         = mjd% - dow% + 1         = mjd% - dow% + 1
-\\  ​If you want to know the ISO year as well as the week, you can return it in an additional parameter:\\ \\ +</​code>​ 
 + 
 +If you want to know the ISO year as well as the week, you can return it in an additional parameter: 
 + 
 +<code bb4w>
         DEF FN_ISOweek(day%,​month%,​year%,​RETURN iyr%)         DEF FN_ISOweek(day%,​month%,​year%,​RETURN iyr%)
         LOCAL mjd%         LOCAL mjd%
         ... remainder as above         ... remainder as above
 +</​code>​
finding_20the_20iso_20week_20number.txt · Last modified: 2018/04/15 10:33 by richardrussell