time.scm 406 B

123456789101112131415
  1. (define-module (lang elisp internals time)
  2. #:use-module (ice-9 optargs)
  3. #:export (format-time-string))
  4. (define* (format-time-string format-string #:optional time universal)
  5. (strftime format-string
  6. ((if universal gmtime localtime)
  7. (if time
  8. (+ (ash (car time) 16)
  9. (let ((time-cdr (cdr time)))
  10. (if (pair? time-cdr)
  11. (car time-cdr)
  12. time-cdr)))
  13. (current-time)))))