# Thread: Day of Week Calculation

1. ## Day of Week Calculation

I need to use SilkTest to determine if a day falls on a Sat/Sunday. Has anyone been able to use the existing date functions in SilkTest for this purpose?

2. ## Re: Day of Week Calculation

</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] testcase test() appstate none
[ ]
[ ] print(GetDayOfWeek(&quot;2005-07-18&quot)
[ ]
[-] STRING GetDayOfWeek(DATETIME dtDate)
[ ]
[ ] INTEGER iDay = GetDateTimePart(dtDate,DTP_DAYOFWEEK)
[ ]
[-] switch iDay
[-] case 0
[ ] return &quot;Sunday&quot;
[-] case 1
[ ] return &quot;Monday&quot;
[-] case 2
[ ] return &quot;Tuesday&quot;
[-] case 3
[ ] return &quot;Wednesday&quot;
[-] case 4
[ ] return &quot;Thursday&quot;
[-] case 5
[ ] return &quot;Friday&quot;
[-] case 6
[ ] return &quot;Saturday&quot;</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

3. ## Re: Day of Week Calculation

Cool! Thanks!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:46 PM.