Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

WeekNum function?

Nov
76
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.
 
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.
 
That plugin also has @USWEEK and @ISOWEEK functions, which may be simpler than parsing the output of @DATECONV.
 

Similar threads

Back
Top