Re: INTEGER-OF-DATE
- From: "Chris" <ctaliercio@xxxxxxxxx>
- Date: 31 Aug 2005 08:07:06 -0700
No, INTEGER-OF-DATE is not a date validation checker.
It returns the integer value of a date, which is extremely useful when
calculating the elapsed number of days between two dates.
The integer value of the date returned by the INTEGER-OF-DATE function
is defined as "the number of days by which the date represented by
argument-1 succeeds December 31, 1600, in the Gregorian calendar."
Using MF Cobol (both OCDS and Server Express) you get a return value of
0 if you pass the function an invalid date. So, in this sense, you
could infact use INTEGER-OF-DATE to tell whether or not you've entered
a valid date. In fact, I've often added a redundant check using the
DATE-OF-INTEGER function to make sure I get back the same value I
started with to absolutely insure that the starting date is indeed
valid.
However, I am not 100% sure whether the result of passing an invalid
date to the INTEGER-OF-DATE function is compiler dependent - you might
want to check into that.
Chris
.
- References:
- INTEGER-OF-DATE
- From: Michael
- INTEGER-OF-DATE
- Prev by Date: INTEGER-OF-DATE
- Previous by thread: INTEGER-OF-DATE
- Index(es):