User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:decode-universal-time [2019/07/14 17:00]
cl:functions:decode-universal-time [2019/10/19 17:00] (current)
Line 1: Line 1:
 +====== Function DECODE-UNIVERSAL-TIME ======
 +
 +====Syntax====
 +  * **decode-universal-time** //​universal-time ''&​optional''​ time-zone// → //second, minute, hour, date, month, year, day, daylight-p, zone//
 +
 +====Arguments and Values====
 +  * //​universal-time//​ - a //​[[CL:​Glossary:​universal time]]//.
 +  * //​time-zone//​ - a //​[[CL:​Glossary:​time zone]]//.
 +  * //second//, //minute//, //hour//, //date//, //month//, //year//, //day//, //​daylight-p//,​ //zone// - a //​[[CL:​Glossary:​decoded time]]//.
 +
 +====Description====
 +Returns the //​[[CL:​Glossary:​decoded time]]// represented by the given //​[[CL:​Glossary:​universal time]]//.
 +If //​time-zone//​ is not supplied, it defaults to the current time zone adjusted for daylight saving time.
 +If //​time-zone//​ is supplied, daylight saving time information is ignored. The daylight saving time flag is **[[CL:​Constant Variables:​nil]]** if //​time-zone//​ is supplied.
 +
 +====Examples====
 +<​blockquote>​
 +(decode-universal-time 0 0) 
 +<r>0
 +0
 +0
 +1
 +1
 +1900, 0
 +//​[[CL:​Glossary:​false]]//​
 +0</r>
 +
 +;;; The next two examples assume Eastern Daylight Time.
 +(decode-universal-time 2414296800 5)
 +<r>0
 +0
 +1
 +4
 +7
 +1976
 +6
 +//​[[CL:​Glossary:​false]]//​
 +5</r>
 +(decode-universal-time 2414293200)
 +<r>0
 +0
 +1
 +4
 +7
 +1976
 +6
 +//​[[CL:​Glossary:​true]]//​
 +5</r>
 +
 +;;; This example assumes that the time zone is Eastern Daylight Time (and that the time zone 
 +;;; is constant throughout the example). ​
 +([[CL:​Special Operators:​let-star|let*]] ((here ([[CL:​Functions:​nth]] 8 ([[CL:​Macros:​multiple-value-list]] ([[CL:​Functions:​get-decoded-time]])))) ; Time zone
 +       ​(recently ([[CL:​Functions:​get-universal-time]]))
 +       ​(daylight-zone-a ([[CL:​Functions:​nthcdr]] 7 ([[CL:​Macros:​multiple-value-list]] (decode-universal-time recently))))
 +       ​(daylight-b ([[CL:​Functions:​nthcdr]] 7 ([[CL:​Macros:​multiple-value-list]] (decode-universal-time recently here)))))
 +  ([[CL:​Functions:​list]] daylight-zone-a daylight-zone-b ​
 +        ([[CL:​Functions:​equal]] daylight-zone-a daylight-zone-b)))
 +<​r>​(([[CL:​Constant Variables:​T]] 5) ([[CL:​Constant Variables:​NIL]] 5) [[CL:​Constant Variables:​NIL]])</​r>​
 +</​blockquote>​
 +
 +====Affected By====
 +//​[[CL:​Glossary:​Implementation-dependent]]//​ mechanisms for calculating when or if daylight savings time is in effect for any given session.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +**[[CL:​Functions:​encode-universal-time|Function ENCODE-UNIVERSAL-TIME]]**,​ **[[CL:​Functions:​get-universal-time|Function GET-UNIVERSAL-TIME]]**,​ {\secref\Time}
 +
 +====Notes====
 +None.
 +
 +\issue{TIME-ZONE-NON-INTEGER:​ALLOW} \issue{DECODE-UNIVERSAL-TIME-DAYLIGHT:​LIKE-ENCODE} \issue{DECODE-UNIVERSAL-TIME-DAYLIGHT:​LIKE-ENCODE}