GDAT$ |
gdat$ is used to build a date from its constituent parts.
gdat$( exp_day, exp_month, exp_year )
|
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 |
# Current date + 6 monthsDATA6M = gdat$(day(date$), month(date$)+6, year(date$))
# that is equivalent to:DATE6M = addmonth(date$, 6)
# Search for the last day of the previous monthMOISPREC = month(gdat$(0, MOIS, ANNEE))
# How many days are there in the current month?NBJOURS = day(gdat$(0, MOIS+1, ANNEE))
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.
|
Error |
Description |
|
ERMODE (10) |
The arguments are not numerical. |
|
ERDATE (56) |
Invalid date. |
DAY - DAY$ - MONTH - MONTH$ - YEAR - DAYN - NDAY - NDAY$ - DATE$ - DATESYST - DATE - EOMONTH - ADXDCS
|
|