Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get year and week of the year?

Status
Not open for further replies.

pjb

Programmer
May 1, 2001
148
US
How do a get the date in CCYYWW format where WW is the numeric week of the year, 01 thru 52. Also, how do I add to get future week?
 
Maybe I answered my own question. I can import it from the UNIX date command. Will this work?. It seems to.

def var CCYYWW as char.
INPUT THROUGH VALUE("date '+%Y%U' ; echo $?") NO-ECHO.
import CCYYWW.
disp CCYYWW.
 
pjb,

If the Unix method works for you then that's fine. However, you should realise that the week number of the year is likely to be governed by the set of business rules your organisation works with - it's not a fixed calendar thing like months & weekdays. There are some guidelines on how to calculate the week number in the Progress Knowledgebase (Kbase #18669) and in the sample code that comes with your installation of Progress ($DLC/src/samples/weeknum.p).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top