x13 Nov 76 1 2020-11-10 #1 Hi all. I'm trying to write a function to get the week number based on a date. Like in Exce's WeekNum function. Except I don't need the date serialised, juste a simple %@WeekNum[%mydate] variant. Any ideas? Thanks.
Hi all. I'm trying to write a function to get the week number based on a date. Like in Exce's WeekNum function. Except I don't need the date serialised, juste a simple %@WeekNum[%mydate] variant. Any ideas? Thanks.
dcantor May 609 4 2020-11-10 #2 Use Charles Dye's ISO8601 plugin, and try something like this Code: function weeknum=`%@word["-./W",1,%@dateconv[%1,5]]` . If you don't use . or / or - as your date separator, put that between the quotation marks with the capital W.
Use Charles Dye's ISO8601 plugin, and try something like this Code: function weeknum=`%@word["-./W",1,%@dateconv[%1,5]]` . If you don't use . or / or - as your date separator, put that between the quotation marks with the capital W.
Charles Dye Super Moderator May 5,387 166 Staff member 2020-11-10 #3 That plugin also has @USWEEK and @ISOWEEK functions, which may be simpler than parsing the output of @DATECONV.
That plugin also has @USWEEK and @ISOWEEK functions, which may be simpler than parsing the output of @DATECONV.