From: Kevin M. Rosenberg Date: Wed, 7 Jan 2004 13:29:24 +0000 (+0000) Subject: r8495: add example function X-Git-Tag: v1.6.1~126 X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;h=fa1d4b3c96a29c739475f5f349bbe7b343643808;p=uffi.git r8495: add example function --- diff --git a/tests/time.lisp b/tests/time.lisp index 279dee0..8e2c6ef 100644 --- a/tests/time.lisp +++ b/tests/time.lisp @@ -90,3 +90,13 @@ (zerop res2)))) t) +(defun posix-time-to-localtime-string (secs) + "Converts number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)" + (string-right-trim + '(#\newline #\return) + (uffi:convert-from-cstring + (uffi:with-foreign-object (time 'time-t) + (setf (uffi:deref-pointer time :unsigned-long) + secs) + (c-ctime time))))) +