X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ftime.lisp;h=aeedba089c3f813bcf1f194fe435c29dd2832e4f;hb=010634515de14538c78c53d26c99d5de0f8d3593;hp=410d14c8174e8006f4290eff0d27834e11a642b3;hpb=cc739f67940b866f1a3b963cd1f35d1c0c81dd0c;p=uffi.git diff --git a/tests/time.lisp b/tests/time.lisp index 410d14c..aeedba0 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-time time))))) +