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

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

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
Asked:
Sandeepiii
  • 3
  • 2
1 Solution
 
woolmilkporcCommented:
Hi,

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

The weekday can be obtained with

say date('W')

Wmp
0
 
SandeepiiiAuthor Commented:
Thanks for your reply i mean to say that,
For example Jan14th 2011 falls in which week,so i want a program which can be universal for any date which i input.
0
 
woolmilkporcCommented:
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
 
SandeepiiiAuthor Commented:
Answer was nice and accurate.
0
 
woolmilkporcCommented:
>> 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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