Skip to content

Instantly share code, notes, and snippets.

@manveru
Created January 23, 2011 20:50
Show Gist options
  • Save manveru/792430 to your computer and use it in GitHub Desktop.
Save manveru/792430 to your computer and use it in GitHub Desktop.
Display Internet Time in Chicken Scheme.
(use posix format)
(setenv "TZ" "UTC-1")
(let ((tl (seconds->local-time (current-seconds))))
(format #t "@~,2F~%" (+ (* (vector-ref tl 2) (/ 1000 24))
(* (vector-ref tl 1) (/ 1000 24 60))
(* (vector-ref tl 0) (/ 1000 24 60 60)))))
@DerGuteMoritz
Copy link

(use posix fmt)
(setenv "TZ" "UTC-1")

(let* ((tl (seconds->local-time (current-seconds)))
       (n (+ (* (vector-ref tl 2) (/ 1000 24))
             (* (vector-ref tl 1) (/ 1000 24 60))
             (* (vector-ref tl 0) (/ 1000 24 60 60)))))
  (fmt #t "@" (num n 10 2)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment