GDAT$

Contents


gdat$ is used to build a date from its constituent parts.

 

Syntax

   gdat$( exp_day,  exp_month, exp_year )

 

Parameters

Element

Description

Restrictions

exp_day

Numerical integer expression for the value of the day.

None.

exp_month

Numerical integer expression for the value of the month.

None.

exp_year

Numerical integer expression for the value of the year.

1600<= exp_year <=9999 or 0

 

Examples

   # Current date + 6 months
    DATA6M = gdat$(day(date$), month(date$)+6, year(date$))
   # that is equivalent to:
    DATE6M = addmonth(date$, 6)
   # Search for the last day of the previous month
    MOISPREC = month(gdat$(0, MOIS, ANNEE))
   # How many days are there in the current month?
    NBJOURS = day(gdat$(0, MOIS+1, ANNEE))

 

Description and comments

gdat$ is used to calculate a date from its 3 components. If it gives a number for the month that is negative or more than 12, the month is recalculated with modulo 12 and the correction made for the year. The same applies for a day number that is negative or greater than the number of days in the current month. This allows calculations such as those given in the examples.

The year may be expressed as 4 digits or as 2, in which case Adonix will use the value for the variable [S]adxdcs to calculate the year, adding these digits to the value of this variable. However gdat$(0,0,0) returns a null date.

The result is a Date type.

 

Associated errors

Error

Description

ERMODE (10)

The arguments are not numerical.

ERDATE (56)

Invalid date.

 

Associated key words

DAY - DAY$ - MONTH - MONTH$ - YEAR - DAYN - NDAY - NDAY$ - DATE$ - DATESYST - DATE - EOMONTH - ADXDCS


CONTENTS


Copyright © Sage 1999 - 2007