Lines Matching defs:year

22        function, that Date.date values are records of year, month, day
25 year: int, (* Signed year. *)
47 (* Vector of days from the beginning of the year. *)
104 (* Time values are since 1st January of this year. *)
106 val yearOffset: int = callTiming 3 0 (* The offset of zeroTime within that year. 0 on both Unix and Windows *)
108 (* Get the day in the year. Either of day or year may be unnormalised
109 but that shouldn't affect the result (except if year is negative???) *)
110 fun dayInYear (day, month, year) =
111 if isLeapYear year then Vector.sub(dayInLeapYearVec, month) + day
119 (* If the year is before the base year we subtract the number of
120 days in this year and recurse. *)
124 (* The year we want is after the base year. *)
138 (* Convert days to number of years plus the day within the year. *)
143 then (* Before the base year: have to add in days. *)
164 (* Get the day and year. The day is a value between 0 and 364/365. *)
165 val (year, days) = daysToYears(LargeInt.toInt(tsecs div secsPerDay))
167 val isLeap = isLeapYear year
177 {year=year, month=month, day=dayInMonth, hour=hrs, minute=mins,
181 (* Get the day in the year. *)
182 fun yearDay({day, month, year, ...}:date) = dayInYear(day, month, year)
185 fun toTime (date as {year, hour, minute, second, offset, ...}) =
190 LargeInt.fromInt(yearDay date + yearToDays year) * secsPerDay +
212 fun date {year, month, day, hour, minute, second, offset} =
230 LargeInt.fromInt (dayInYear(day, monthToMonthNo month, year) + yearToDays year) * secsPerDay +
239 val year: date->int = #year
250 fun dayOfWeek({year, month, day, ...}: date) =
259 val yy0 = if m0 <= 2 then year-1 else year
284 fun compare({year=y1, month=m1, day=d1, hour=h1, minute=n1, second=s1, ...}:date,
285 {year=y2, month=m2, day=d2, hour=h2, minute=n2, second=s2, ...}:date) =
370 (* A year is represented as four digits. *)
411 | SOME(year, str9) =>
412 SOME(date{year=year, month=mth, day=day,
427 fun toString (date as {year, month, day, hour, minute, second, ...}: date) =
445 int2str 4 year]
448 fun fmt s (date as {year, month, day, hour, minute, second, offset}) =
479 callTiming 6 (newFormat, year, month, day, hour, minute, second,