(C) 1998 AROS - The Amiga Research OS


NAME
#include <utility/date.h>
#include <proto/utility.h>

ULONG CheckDate (date)

LOCATION
In UtilityBase at offset 22

SYNOPSIS
struct ClockData * date

FUNCTION
Examine the date described in the ClockData structure and determine whether it is a valid date. In particular this checks whether the ranges of the fields are within normal limits.

This function does not check whether the wday field of the ClockData structure is valid.

INPUTS
date
A ClockData structure desribing the date to check.

RESULT
If the date is valid, the number of seconds from midnight 1-Jan-1978 AD to the date, or 0 if the date is invalud.

EXAMPLE

SEE ALSO
Amiga2Date(), Date2Amiga()

NOTES
The date 01-Jan-78 00:00:00 is actually returned as invalid.

This also assumes that the ClockDate refers to a date in the Gregorian calendar. (60 sec/min, 60 min/hour, 24 hr/day, 12 months/year).

BUGS
Does not check whether the 29/2 is valid outside of a leap year.

INTERNALS
Since all the values are unsigned, we don't have to check for < 0 in fields which range from 0 ... n.

HISTORY
20.10.1998 hkiel
Amiga Research OS
20.08.1997 digulla
Polish.

Renamed utility_intern.h to intern.h.

03.02.1997 ldp
Changed <proto/*_protos.h> to <proto/*.h>
02.02.1997 iaint
Some bug fixes, math functions and native Amiga support
27.01.1997 ldp
Polish
08.01.1997 iaint
A few more utility.lib functions