|
|
Five auxiliary functions are provided for working with Times. These have all been defined as static members of class Time to avoid polluting the global namespace.
Time::is_leap(1987) // returns 0 Time::is_leap(1988) // returns 1
Time::days_in_year(1987) // returns 365 Time::days_in_year(1988) // returns 366
Time::days_in_month(Time::february,1988) // returns 29
Time::first_day(Time::february,1988) // returns 32
Time::valid_date(1988,Time::february,29) // returns 1 Time::valid_date(1989,Time::february,29) // returns 0
For an example that uses Time::valid_date(), see ``Constructors'' section.