Coverage report: /home/ellis/comp/core/lib/obj/time/util.lisp

KindCoveredAll%
expression032 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; util.lisp --- Time Utils
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :obj/time)
7
 
8
 ;; from hunchentoot/util.lisp - these variants are more portable than the
9
 ;; local.lisp alternatives.
10
 (defun rfc-1123-date (&optional (time (get-universal-time)))
11
   "Generates a time string according to RFC 1123. Default is current time.
12
 This can be used to send a 'Last-Modified' header - see
13
 HUNCHENTOOT::HANDLE-IF-MODIFIED-SINCE."
14
   (multiple-value-bind
15
         (second minute hour date month year day-of-week)
16
       (decode-universal-time time 0)
17
     (format nil "~A, ~2,'0d ~A ~4d ~2,'0d:~2,'0d:~2,'0d GMT"
18
             (svref +day-names+ day-of-week)
19
             date
20
             (svref +month-names+ (1- month))
21
             year
22
             hour
23
             minute
24
             second)))
25
 
26
 (defun iso-time (&optional (time (get-universal-time)))
27
   "Returns the universal time TIME as a string in full ISO format."
28
   (multiple-value-bind (second minute hour date month year)
29
       (decode-universal-time time)
30
     (format nil "~4,'0d-~2,'0d-~2,'0d ~2,'0d:~2,'0d:~2,'0d"
31
             year month date hour minute second)))