summaryrefslogtreecommitdiff
path: root/module/srfi
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2019-08-02 15:04:42 +0200
committerAndy Wingo <wingo@pobox.com>2019-08-02 15:04:42 +0200
commit7c5579909e8bf8bd7f5d718c5d0fd36aa5c3af99 (patch)
tree7a00876c32f6fd89284e506eff37eb82eda8e484 /module/srfi
parentb3b14fe6a217244a8566ca6ee9bf040fe877b37c (diff)
parent2980b66f6f536aeef3aee114c07fcbc86128a704 (diff)
downloadguile-7c5579909e8bf8bd7f5d718c5d0fd36aa5c3af99.tar.gz
Merge from stable-2.2
Diffstat (limited to 'module/srfi')
-rw-r--r--module/srfi/srfi-19.scm22
1 files changed, 11 insertions, 11 deletions
diff --git a/module/srfi/srfi-19.scm b/module/srfi/srfi-19.scm
index 66939f92c..948a34eef 100644
--- a/module/srfi/srfi-19.scm
+++ b/module/srfi/srfi-19.scm
@@ -156,13 +156,13 @@
(define iso-8601-date-time-format "~Y-~m-~dT~H:~M:~S~z")
;;-- Miscellaneous Constants.
-;;-- only the tai-epoch-in-jd might need changing if
+;;-- only the utc-epoch-in-jd might need changing if
;; a different epoch is used.
(define nano 1000000000) ; nanoseconds in a second
(define sid 86400) ; seconds in a day
(define sihd 43200) ; seconds in a half day
-(define tai-epoch-in-jd 4881175/2) ; julian day number for 'the epoch'
+(define utc-epoch-in-jd 4881175/2) ; julian day number for 'the epoch'
;; FIXME: should this be something other than misc-error?
(define (time-error caller type value)
@@ -181,7 +181,7 @@
(define (read-tai-utc-data filename)
(define (convert-jd jd)
- (* (- (inexact->exact jd) tai-epoch-in-jd) sid))
+ (* (- (inexact->exact jd) utc-epoch-in-jd) sid))
(define (convert-sec sec)
(inexact->exact sec))
(let ((port (open-input-file filename))
@@ -611,7 +611,7 @@
(define (time->julian-day-number seconds tz-offset)
(+ (/ (+ seconds tz-offset sihd)
sid)
- tai-epoch-in-jd))
+ utc-epoch-in-jd))
(define (tai-before-leap-second? second)
(any (lambda (x)
@@ -667,9 +667,9 @@
(define (date->time-utc date)
(let* ((jdays (- (encode-julian-day-number (date-day date)
- (date-month date)
- (date-year date))
- tai-epoch-in-jd))
+ (date-month date)
+ (date-year date))
+ utc-epoch-in-jd))
;; jdays is an integer plus 1/2,
(jdays-1/2 (inexact->exact (- jdays 1/2))))
(make-time
@@ -798,7 +798,7 @@
(time-error 'time-utc->julian-day 'incompatible-time-types time))
(+ (/ (+ (time-second time) (/ (time-nanosecond time) nano))
sid)
- tai-epoch-in-jd))
+ utc-epoch-in-jd))
(define (time-utc->modified-julian-day time)
(- (time-utc->julian-day time)
@@ -810,7 +810,7 @@
(+ (/ (+ (tai->utc (time-second time))
(/ (time-nanosecond time) nano))
sid)
- tai-epoch-in-jd))
+ utc-epoch-in-jd))
(define (time-tai->modified-julian-day time)
(- (time-tai->julian-day time)
@@ -823,14 +823,14 @@
(+ (/ (+ (tai->utc (time-second time))
(/ (time-nanosecond time) nano))
sid)
- tai-epoch-in-jd))
+ utc-epoch-in-jd))
(define (time-monotonic->modified-julian-day time)
(- (time-monotonic->julian-day time)
4800001/2))
(define (julian-day->time-utc jdn)
- (let ((secs (* sid (- jdn tai-epoch-in-jd))))
+ (let ((secs (* sid (- jdn utc-epoch-in-jd))))
(receive (seconds parts)
(split-real secs)
(make-time time-utc