Class DT_GREGORIAN_CALENDAR |

note

description:"Gregorian calendar properties"library:"Gobo Eiffel Time Library"author:"Eric Bezault <ericb@gobosoft.com>"copyright:"Copyright (c) 2000-2001, Eric Bezault and others"license:"MIT License"

class interface

DT_GREGORIAN_CALENDAR

-- Yearfeature

leap_year(y:INTEGER):BOOLEAN-- Isya leap year?Months_in_year:INTEGER-- Number of months in a yearensuredefinition:Result= (December-Januray+1)Days_in_year:INTEGERDays_in_leap_year:INTEGER-- Number of days in a (leap) yearDays_in_400_years:INTEGERDays_in_100_years:INTEGERDays_in_4_years:INTEGERDays_in_3_years:INTEGERDays_in_3_leap_years:INTEGERDays_in_2_years:INTEGERDays_in_2_leap_years:INTEGER-- Number of days in multiple years

-- Monthfeature

January:INTEGERFebruary:INTEGERMarch:INTEGERApril:INTEGERMay:INTEGERJune:INTEGERJuly:INTEGERAugust:INTEGERSeptember:INTEGEROctober:INTEGERNovember:INTEGERDecember:INTEGER-- Monthsdays_in_month(m,y:INTEGER):INTEGER-- Number of days in monthmof yearyrequirem_large_enough:m>=Januarym_small_enough:m<=Decemberensureat_least_one:Result>=1max_days_in_month:Result<=Max_days_in_monthMax_days_in_month:INTEGER-- Maximum number of days in a monthdays_at_month(m,y:INTEGER):INTEGER-- Number of days from beginning of year --yuntil beginning of monthmrequirem_large_enough:m>=Januarym_small_enough:m<=Decemberensuredays_positive:Result>=0

-- Week dayfeature

Sunday:INTEGERMonday:INTEGERTuesday:INTEGERWednesday:INTEGERThursday:INTEGERFriday:INTEGERSaturday:INTEGER-- Week daysDays_in_week:INTEGER-- Number of days in a weekensuredefinition:Result= (Saturday-Sunday+1)next_day(d:INTEGER):INTEGER-- Week day afterdrequired_large_enough:d>=Sundayd_small_enough:d<=Saturdayensuresunday_definition: (d=Sunday)implies(Result=Monday)monday_definition: (d=Monday)implies(Result=Tuesday)tuesday_definition: (d=Tuesday)implies(Result=Wednesday)wednesday_definition: (d=Wednesday)implies(Result=Thursday)thursday_definition: (d=Thursday)implies(Result=Friday)friday_definition: (d=Friday)implies(Result=Saturday)saturday_definition: (d=Saturday)implies(Result=Sunday)previous_day(d:INTEGER):INTEGER-- Week day beforedrequired_large_enough:d>=Sundayd_small_enough:d<=Saturdayensuresunday_definition: (d=Sunday)implies(Result=Saturday) monday_definition: (d=Monday)implies(Result=Sunday) tuesday_definition: (d=Tuesday)implies(Result=Monday) wednesday_definition: (d=Wednesday)implies(Result=Tuesday) thursday_definition: (d=Thursday)implies(Result=Wednesday) friday_definition: (d=Friday)implies(Result=Thursday) saturday_definition: (d=Saturday)implies(Result=Friday)

-- Timefeature

Seconds_in_minute:INTEGER-- Number of seconds in a minuteSeconds_in_hour:INTEGER-- Number of seconds in an hourSeconds_in_day:INTEGER-- Number of seconds in a dayMilliseconds_in_day:INTEGER-- Number of milliseconds in a dayMinutes_in_hour:INTEGER-- Number of minutes in an hourHours_in_day:INTEGER-- Number of hours in a day

-- Epochfeature

Epoch_year:INTEGEREpoch_month:INTEGEREpoch_day:INTEGER-- Epoch date (1 Jan 1970)epoch_days(y,m,d:INTEGER):INTEGER-- Number of days since epoch date (1 Jan 1970)requirem_large_enough:m>=Januarym_small_enough:m<=Decemberd_large_enough:d>=1d_small_enough:d<=days_in_month(m,y)

-- class DT_GREGORIAN_CALENDARend

Copyright © 2000-2001, Eric
Bezault mailto:ericb@gobosoft.comhttp://www.gobosoft.comLast Updated: 8 April 2001 |