1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/f_get_un.htm
2024-04-01 10:24:07 +02:00

74 lines
5.4 KiB
HTML

<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Function GET-UNIVERSAL-TIME, GET-DECODED-TIME</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="f_encode.htm">
<LINK REL=UP HREF="c_enviro.htm">
<LINK REL=NEXT HREF="f_sleep.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="f_encode.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_enviro.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="f_sleep.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<A NAME="get-universal-time"><A NAME="get-decoded-time"><I>Function</I> <B>GET-UNIVERSAL-TIME, GET-DECODED-TIME</B></A></A> <P>
<P><B>Syntax:</B><P>
<P>
<B>get-universal-time</B> <I><I>&lt;no arguments&gt;</I></I> =&gt; <I>universal-time</I><P>
<P>
<B>get-decoded-time</B> <I><I>&lt;no arguments&gt;</I></I><P> =&gt; <I>second, minute, hour, date, month, year, day, daylight-p, zone</I><P>
<P>
<P><B>Arguments and Values:</B><P>
<P>
<I>universal-time</I>---a <A REL=DEFINITION HREF="26_glo_u.htm#universal_time"><I>universal time</I></A>. <P>
<I>second</I>, <I>minute</I>, <I>hour</I>, <I>date</I>, <I>month</I>, <I>year</I>, <I>day</I>, <I>daylight-p</I>, <I>zone</I>---a <A REL=DEFINITION HREF="26_glo_d.htm#decoded_time"><I>decoded time</I></A>. <P>
<P><B>Description:</B><P>
<P>
<A REL=DEFINITION HREF="#get-universal-time"><B>get-universal-time</B></A> returns the current time, represented as a <A REL=DEFINITION HREF="26_glo_u.htm#universal_time"><I>universal time</I></A>. <P>
<A REL=DEFINITION HREF="#get-decoded-time"><B>get-decoded-time</B></A> returns the current time, represented as a <A REL=DEFINITION HREF="26_glo_d.htm#decoded_time"><I>decoded time</I></A>. <P>
<P><B>Examples:</B><P>
<P>
<PRE>
;; At noon on July 4, 1976 in Eastern Daylight Time.
(get-decoded-time) =&gt; 0, 0, 12, 4, 7, 1976, 6, <A REL=DEFINITION HREF="26_glo_t.htm#true">true</A>, 5
;; At exactly the same instant.
(get-universal-time) =&gt; 2414332800
;; Exactly five minutes later.
(get-universal-time) =&gt; 2414333100
;; The difference is 300 seconds (five minutes)
(- * **) =&gt; 300
</PRE>
</TT> <P>
<P><B>Side Effects:</B> None.
<P>
<P><B>Affected By:</B><P>
<P>
The time of day (i.e., the passage of time), the system clock's ability to keep accurate time, and the accuracy of the system clock's initial setting. <P>
<P><B>Exceptional Situations:</B><P>
<P>
An error of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_error.htm#error"><B>error</B></A> might be signaled if the current time cannot be determined. <P>
<P><B>See Also:</B><P>
<P>
<A REL=DEFINITION HREF="f_dec_un.htm#decode-universal-time"><B>decode-universal-time</B></A>, <A REL=DEFINITION HREF="f_encode.htm#encode-universal-time"><B>encode-universal-time</B></A>, <A REL=CHILD HREF="25_ad.htm">Section 25.1.4 (Time)</A> <P>
<P><B>Notes:</B><P>
<P>
<PRE>
(get-decoded-time) == (decode-universal-time (get-universal-time))
</PRE>
</TT> <P>
No <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A> is required to have a way to verify that the time returned is correct. However, if an <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A> provides a validity check (e.g., the failure to have properly initialized the system clock can be reliably detected) and that validity check fails, the <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A> is strongly encouraged (but not required) to signal an error of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_error.htm#error"><B>error</B></A> (rather than, for example, returning a known-to-be-wrong value) that is <A REL=DEFINITION HREF="26_glo_c.htm#correctable"><I>correctable</I></A> by allowing the user to interactively set the correct time. <P>
<HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>