[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 516

# week day of the year

Hi,
How can i find week day of the year,using REXX.
Any help would be welcome,Thanks
0
Sandeepiii
• 3
• 2
1 Solution

Commented:
Hi,

what is a week day "of the year" for you?

The weekday can be obtained with

say date('W')

Wmp
0

Author Commented:
For example Jan14th 2011 falls in which week,so i want a program which can be universal for any date which i input.
0

Commented:
There's no "number of week" calculation in the date function, unfortunately.

You could get a rough approximation with this:

say (date('D','20110114','S')+4)%7

which is nothing else than a rounded integer division of the number of days elapsed in the year by seven.

The format of the second parameter is determined by the third parameter, sou you could as well do:

say (date('D','14 Jan 2011','N')+4)%7

wmp

0

Author Commented:
0

Commented:
>> Answer was nice and accurate. <<

Why did you give a grade "B" then?

If this was a mistake please click"Request Attention" and have a moderator correct your decision.

Thx for the points anyway!

wmp
0

## Featured Post

• 3
• 2
Tackle projects and never again get stuck behind a technical roadblock.