Date and TimeGBBopen ToolsTransitioning Sets and TablesOffset Universal TimeGoTo Top

Offset Universal Time

Common Lisp has three time representations: Decoded Time, Universal Time, and Internal Time. Universal Time (UT) allows specific points in time from the beginning of 1900 to be represented with one-second resolution (ignoring leap seconds). The disadvantage of absolute Universal Time values is that they are bignums in most Common Lisp implementations.

To reduce computation and storage requirements, a fourth time representation, Offset Universal Time (OT), can be used. Offset Universal Time is Universal Time that is offset by an integer time-base value so that the most often used Offset Universal Time values in an application are fixnums.

Nearly all Common Lisp implementations provide fixnums of at least 30 bits (34 years of time range) or more, but CLISP on 32-bit machines provides only 25 bits (388 days). The ANSI standard requires an implementation to provide fixnums with at least 16 bits (only 18 hours), but fortunately Common Lisp implementations are considerably more generous!

When developing applications that must represent time values that exceed the fixnum range, it is important to choose the best time-base offset value to reduce bignum costs. Of course, existing Offset Universal Time values will appear shifted if the time-base offset value is changed.

Entities


The GBBopen Project


Date and TimeGBBopen ToolsTransitioning Sets and TablesOffset Universal TimeGoTo Top