Show source file in small font In time: Link from constants to it's cross reference table entry 
;; constants ;; Fixed second counts and calendar facts. Show source file in small font In time: Link from seconds-in-a-normal-year to it's cross reference table entry 2.1. Dealing with years
(define seconds-in-a-normal-year 31536000) Show source file in small font In time: Link from seconds-in-a-leap-year to it's cross reference table entry 2.1. Dealing with years
(define seconds-in-a-leap-year 31622400) Show source file in small font In time: Link from seconds-in-a-week to it's cross reference table entry 
(define seconds-in-a-week 604800) Show source file in small font In time: Link from seconds-in-a-day to it's cross reference table entry 2.2. Dealing with days, hours, minutes, and seconds
(define seconds-in-a-day 86400) Show source file in small font In time: Link from seconds-in-an-hour to it's cross reference table entry 2.2. Dealing with days, hours, minutes, and seconds
(define seconds-in-an-hour 3600) Show source file in small font In time: Link from base-year to it's cross reference table entry 2.1. Dealing with years
(define base-year 1970) Show source file in small font In time: Link from month-length-normal-year to it's cross reference table entry 2.3. Dealing with months
(define month-length-normal-year (vector 31 28 31 30 31 30 31 31 30 31 30 31)) Show source file in small font In time: Link from functions to it's cross reference table entry 
;; functions ;; The section of functions. ; Return whether y is a leap year Show source file in small font In time: Link from leap-year to it's cross reference table entry 2.1. Dealing with years
(define (leap-year y) (cond ((= (modulo y 400) 0) #t) ((= (modulo y 100) 0) #f) ((= (modulo y 4) 0) #t) (else #f))) ; Return a list of year and remainding seconds of the second ; counter n. Show source file in small font In time: Link from years-and-seconds to it's cross reference table entry 2.1. Dealing with years 2.4. Putting it all together
(define (years-and-seconds n) (cycle-years 0 base-year n)) ; Count years by increasing n and decreasing u until u is less than the seconds in a year. ; Both n and u are integeres representing a number of seconds. ; Returns a list of year and remaining seconds (less than a year). Show source file in small font In time: Link from cycle-years to it's cross reference table entry 2.1. Dealing with years
(define (cycle-years n year u) (let ((year-length (if (leap-year year) seconds-in-a-leap-year seconds-in-a-normal-year))) (if (< u year-length) (list year u) (cycle-years (+ n year-length) (+ 1 year) (- u year-length))))) ; Return the number days, hours, minutes and seconds in second count n. ; n is less than the number of seconds in a year Show source file in small font In time: Link from how-many-days-hours-minutes-seconds to it's cross reference table entry 2.2. Dealing with days, hours, minutes, and seconds 2.4. Putting it all together
(define (how-many-days-hours-minutes-seconds n) (let* ((days (quotient n seconds-in-a-day)) ; A linked program source marker to section 2.2:
'Dealing with days, hours, minutes, and seconds'
Mark char: a (n-rest-1 (modulo n seconds-in-a-day)) ; A linked program source marker to section 2.2:
'Dealing with days, hours, minutes, and seconds'
Mark char: b (hours (quotient n-rest-1 seconds-in-an-hour)) ; A linked program source marker to section 2.2:
'Dealing with days, hours, minutes, and seconds'
Mark char: c (n-rest-2 (modulo n-rest-1 seconds-in-an-hour)) ; A linked program source marker to section 2.2:
'Dealing with days, hours, minutes, and seconds'
Mark char: d (minutes (quotient n-rest-2 60)) ; A linked program source marker to section 2.2:
'Dealing with days, hours, minutes, and seconds'
Mark char: e (seconds (modulo n-rest-2 60))) ; A linked program source marker to section 2.2:
'Dealing with days, hours, minutes, and seconds'
Mark char: f (list days hours minutes seconds))) ; Return a list of day and moth given a number of days in year. ; Day-count is a number of days in a year. Show source file in small font In time: Link from day-and-month to it's cross reference table entry 2.3. Dealing with months 2.4. Putting it all together
(define (day-and-month day-count year) (day-and-month-help 0 1 year (+ 1 day-count)) ) Show source file in small font In time: Link from day-and-month-help to it's cross reference table entry 2.3. Dealing with months
(define (day-and-month-help n m y c) (if (<= c (days-in-month m y)) (list c m) (day-and-month-help (+ n (days-in-month m y)) (+ m 1) y (- c (days-in-month m y))))) ; Return the number of days in month and year Show source file in small font In time: Link from days-in-month to it's cross reference table entry 2.3. Dealing with months
(define (days-in-month month year) (if (= month 2) (if (leap-year year) 29 28) (vector-ref month-length-normal-year (- month 1)))) ; Return a list of year month day hours minutes seconds from n, ; which represents the number of seconds elapsed since January 1, 1970. Show source file in small font In time: Link from time-decode to it's cross reference table entry 1.1. Time systems and functions  1.2. The plan of attack 2.4. Putting it all together 3.1. Final remarks
(define (time-decode n) (let* ((year-seconds (years-and-seconds n)) ; A linked program source marker to section 2.4:
'Putting it all together'
Mark char: a (year (car year-seconds)) (days-hours-minutes-seconds ; A linked program source marker to section 2.4:
'Putting it all together'
Mark char: b (how-many-days-hours-minutes-seconds (cadr year-seconds))) (hours (second days-hours-minutes-seconds)) (minutes (third days-hours-minutes-seconds)) (seconds (fourth days-hours-minutes-seconds)) (day-month (day-and-month (first days-hours-minutes-seconds) year)) ; A linked program source marker to section 2.4:
'Putting it all together'
Mark char: c (day (first day-month)) (month (second day-month))) (list year month day hours minutes seconds)))