home *** CD-ROM | disk | FTP | other *** search
- /*********
- *
- * _TR_ISDS.C
- *
- * by Tom Rettig
- *
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * Syntax: _tr_isdsvalid( <date string> )
- * Return: TRUE if <date string> is a valid date, otherwise FALSE
- * Note : <date string> is *char in the DTOS() format "YYYYMMDD"
- ********/
-
- #include "trlib.h"
-
- int _tr_isdsvalid(ds)
- char *ds;
- {
-
- if ( ISDS(ds) ) /* ds is in date string format */
- {
- /* _tr_ldm() returns zero if invalid month or year */
- return( DSDAY(ds) >= 1 && DSDAY(ds) <= _tr_ldm(DSMONTH(ds),DSYEAR(ds)) );
- }
- else
- return( FALSE );
- }
-
-
-