# iso week number in Eggplant

denis gay
Member

Hi,

is there a quick way to get the iso week number in Eggplant ?

Thanks

is there a quick way to get the iso week number in Eggplant ?

Thanks

#### Categories

- 2.9K All Categories
- 105 Products
- 5 Eggplant AI
- 2K Eggplant Functional
- 20 Eggplant Performance
- Eggplant Automation Cloud
- 4 Eggplant Manager
- Eggplant Network
- 2 Eggplant Integrations
- 1 Ecosystem
- 1 Eggplant Real Customer Insights
- 1 Eggplant Monitoring Insights
- 1 Eggplant Performance Analyzer
- 16 Industries
- Automotive
- 1 Defense & Aerospace
- Enterprise
- Financial Services
- 13 Healthcare & Life Sciences
- 1 Retail
- 1 Telecom & Media
- 2.8K TestPlant
- 21 Other TestPlant Products
- 4 QA and Testing
- 42 eggPlant Examples
- 745 Vine
- 12 Targeted Topics
- 12 Testing Epic Implementations

## Comments

No, the ISO Week number isn't something that's built into SenseTalk (yet!), but in searching to see what this was, I found an algorithm to calculate it posted by Rick McCarty. I implemented his approach in this weekDate function: This function returns a list containing the year number, the week number, and the day of the week for any date that is passed to the function. If you don't pass a date it assumes the current date.

I've also uploaded a script file containing a slightly modified version of this handler and a couple of additional handlers to return just the week number and to return the date in a standard ISO 8601 Week Day format. The script includes some test code that produces this output:

2008-09-16 is 2008-W38-2

2005-01-01 is 2004-W53-6

2005-01-02 is 2004-W53-7

2005-01-03 is 2005-W01-1

2005-12-31 is 2005-W52-6

2007-01-01 is 2007-W01-1

2007-12-30 is 2007-W52-7

2007-12-31 is 2008-W01-1

2008-01-01 is 2008-W01-2

2008-12-28 is 2008-W52-7

2008-12-29 is 2009-W01-1

2008-12-31 is 2009-W01-3

2009-01-01 is 2009-W01-4

2009-12-31 is 2009-W53-4

2010-01-01 is 2009-W53-5

2010-01-02 is 2009-W53-6

2010-01-03 is 2009-W53-7

2010-01-04 is 2010-W01-1

I don't guarantee that this will produce the correct results in all cases, but it seems to be working as expected. Good luck!

I just had to modifiy something in order to avoid an error message.

I replaced all the "to hanble handleName of aParameter" with "to handle handleName(aParameter)" and it works perfectly (up to now).

Thanks again.