AWEEK

Contents


aweek enables you to find the start date for a given week in a given year.

 

Syntax

   aweek(week_exp, year_exp)

 

Parameters

Element

Description

Restrictions

week_exp

Expression of the Integer type that gives the number of the week.

None

year_exp

Expression of the Integer type that gives the number of the year.

1600<=year_exp<=9999
or 0<=year_exp<=99

Examples

   # Give the date of the Wednesday of week 37 of this year.
    WDATE = aweek(37,year(date$))+2
    Infbox "The date is:  "-WDATE
   Let us perform a few tests with the Adonix calculator.
    aweek(1.1993)      -->       [04.01.93]
    aweek(0,1993)      -->       [12/28/1992]
    aweek(-1,1993)      -->       [12/21/1992]

 

Description and Comments

The aweek function allows you to calculate the date of the first day (Monday) of a given week for a given year. The weeks are numbered from zero to 53. The calculation method (in compliance with ISO standard #8601) is the following:

The week begins on Monday (day 1) and ends on Sunday (day 7).

The first week of the year is the one that includes the first Thursday of the year. If the first day of the year is a Friday, Saturday, or Sunday, there is therefore a week zero (0), which goes from January 1st to the first Sunday of January, inclusive.

If the year is given in only two digits, i.e., between zero (0) and 99, Adonix uses the value defined by the [S]adxdcs variable
to determine in which year you should add these two digits to the value of [S]adxcds.

 

Associated Errors

Error

Description

ERMODE (10)

The parameters are not numeric.

ERDATE (56)

Parameter invalid (year or week too high or too low)

 

Associated Keywords

DATE - WEEK - DAY - DAY$ - MONTH - MONTH$ - YEAR - NDAY - NDAY$ - ADXDCS


CONTENTS


Copyright © Sage 1999 - 2007