Up to now the only I could think of is
(defconstant +secs/hour+ 3600)
(defconstant +secs/day+ #.(* 24 +secs/hour+))
(defun utime-to-days (utime)
(destructuring-bind (daylight-p zone)
(subseq (multiple-value-list (decode-universal-time utime)) 7)
(floor (+ +secs/day+ (- utime (* (if daylight-p
But reverse seems much more difficult.
Could you give some hints here ? Which direction I should go ?
In article <3D46C632...@eurocom.od.ua>, Vladimir Zolotykh
This is not necessarily true. Depending on how far in the future you
go, leap seconds may throw you off.
If you ignore this, you may want to base your times on noon instead of
midnight, so that a one-second change won't throw you off by a full
You can look for a paper entitled "A Long, Drawn-Out History of Time",
and the Lisp library LOCAL-TIME it inspired, so you don't have to deal
with some of the problems it's dealt with already.
Or just use encode- and decode-universal time.
The paper's title is "The Long, Painful History of Time". You'll find it at
<http://naggum.no/lugm-time.html>. Another excellent suggestion is "A Brief
History of Time".
Erik Naggum, Oslo, Norway
Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.
Thanks... Sorry about the mistake.
"Always... never... forget to check your references."
- Real Genius
The latest LOCAL-TIME's source is at
cvs -d:pserver:ano...@alpha.onshored.com:/cvs co local-time
[I've tried http://sourcery.naggum.no/lisp/local-time.html. It was
not responding at the time of my trying.]
Where is the LOCAL-TIME you've referenced to ? I've tried
LOCAL-TIME from alpha.onshored.com:/cvs. To almost all my
attempts to use timezone it answers
Error: not implemented.