aboutsummaryrefslogtreecommitdiffstats
path: root/cltime.scm
diff options
context:
space:
mode:
authorThomas Bushnell, BSG <tb@debian.org>2005-11-02 14:55:21 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:32 -0800
commit34c54a22ff7818bb8b38ef4d9c87dbbcb221ba73 (patch)
tree1189d06a81277bcf8539b0260a69a19f6038effb /cltime.scm
parent611b3db17894e5fdc0db3d49eaf6743d27b44233 (diff)
parent5145dd3aa0c02c9fc496d1432fc4410674206e1d (diff)
downloadslib-34c54a22ff7818bb8b38ef4d9c87dbbcb221ba73.tar.gz
slib-34c54a22ff7818bb8b38ef4d9c87dbbcb221ba73.zip
Import Debian changes 3a2-1debian/3a2-1
slib (3a2-1) unstable; urgency=low * New upstream release. * Acknowledge NMU. (Closes: #281809) * Makefile: Don't hack Makefile; use rules instead. * debian/rules: Set on make invocations: prefix, htmldir, TEXI2HTML. * debian/rules (clean): Clean more stuff here. * Makefile: Comment out old rule for $(htmldir)slib_toc.html. Instead, specify directly that the texi2html invocation produces that file. * debian/rules (binary-indep): Find web files in slib subdir. * debian/control (Build-Depends-Indep): Go back to using scm.
Diffstat (limited to 'cltime.scm')
-rw-r--r--cltime.scm22
1 files changed, 13 insertions, 9 deletions
diff --git a/cltime.scm b/cltime.scm
index 76d06d2..c271da2 100644
--- a/cltime.scm
+++ b/cltime.scm
@@ -18,10 +18,12 @@
;each case.
(require 'values)
+(require 'time-core)
(require 'time-zone)
-(require 'posix-time)
-(define time:1900 (time:invert time:gmtime '#(0 0 0 1 0 0 #f #f 0 0 "GMT")))
+(define time:1900 (time:invert
+ (lambda (tm) (time:split tm 0 0 "GMT")) ;time:gmtime
+ '#(0 0 0 1 0 0 #f #f 0 0 "GMT")))
;@
(define (get-decoded-time)
(decode-universal-time (get-universal-time)))
@@ -33,7 +35,7 @@
(let ((tv (apply time:split
(offset-time time:1900 utime)
(if (null? tzarg)
- (tz:params utime (tzset))
+ (tz:params utime (time-zone (getenv "TZ")))
(list 0 (* 3600 (car tzarg)) "???")))))
(values
(vector-ref tv 0) ;second [0..59]
@@ -50,10 +52,10 @@
)))
;@
(define (encode-universal-time second minute hour date month year . tzarg)
- (let* ((tz (if (null? tzarg)
- (tzset)
- (time-zone (string-append
- "???" (number->string (car tzarg))))))
+ (let* ((tz (time-zone
+ (if (null? tzarg)
+ (getenv "TZ")
+ (string-append "???" (number->string (car tzarg))))))
(tv (vector second
minute
hour
@@ -63,5 +65,7 @@
#f ;ignored
#f ;ignored
)))
- (difftime (time:invert localtime tv) time:1900)))
-
+ (difftime (time:invert
+ (lambda (tm) (apply time:split tm (tz:params tm tz))) ;localtime
+ tv)
+ time:1900)))