X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=datetime.lisp;h=288d3c85740bd616cde4234cd99364e4ff404fdc;hp=4a4dbe2e321feae2789864b0d657c82759a9a1c6;hb=2f65fd6d93691f3943182138efd2013c3fdb67c7;hpb=98d7b650aa611a0de537ace581cde47c66071af3 diff --git a/datetime.lisp b/datetime.lisp index 4a4dbe2..288d3c8 100644 --- a/datetime.lisp +++ b/datetime.lisp @@ -68,6 +68,11 @@ (t (format t "~,2F ~A" val unit)))) +(defconstant +posix-epoch+ + (encode-universal-time 0 0 0 1 1 1970 0)) + +(defun posix-time-to-utime (time) + (+ time +posix-epoch+)) ;;;; Daylight Saving Time calculations @@ -101,3 +106,4 @@ ;; 2007 April 1 October 28 March 25 October 28 ;; 2008 April 6 October 26 March 30 October 26 +