This shows you the differences between two versions of the page.
finding_20the_20iso_20week_20number [2018/03/31 14:19] 127.0.0.1 external edit |
finding_20the_20iso_20week_20number [2018/04/15 11: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:// | + | //by Richard Russell, November 2015//\\ \\ The code listed below finds the [[https:// |
+ | |||
+ | <code bb4w> | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
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 bb4w> | ||
DEF FN_ISOweek(day%, | DEF FN_ISOweek(day%, | ||
LOCAL mjd% | LOCAL mjd% | ||
... remainder as above | ... remainder as above | ||
+ | </ |