X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftime.lisp;h=8e2c6efcef4dbee009492f88f960b2c9d62e2e6d;hb=fa1d4b3c96a29c739475f5f349bbe7b343643808;hp=410d14c8174e8006f4290eff0d27834e11a642b3;hpb=cc739f67940b866f1a3b963cd1f35d1c0c81dd0c;p=uffi.git diff --git a/tests/time.lisp b/tests/time.lisp index 410d14c..8e2c6ef 100644 --- a/tests/time.lisp +++ b/tests/time.lisp @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: time.lisp,v 1.3 2003/08/23 12:36:59 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -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))))) +