[libgfc Index] [libgfc Hierarchy] [Headers]
GFC's timestamp class More...
#include <src/gadt_time.h>
Inherits: GTemporal
GFC's timestamp class.
GTimestamp is based on the work by MultiCal project of U.
Arizona.
GLOSSARY
CHRONON: Unit of time measuring as adopted by a clock. A second
for our purpose. (Would geographical features be
measured to a microsecond??)
TIMESTAMP: A paticular time in the history. Defined by the
number of chronons from the origin.
SPAN: A period of time. A FIXED span is just a count of
chronons; while a VARIABLE span (line a 'month')
may have a duration that depends on a paticular calendar.
ORIGIN: We specify "Midnight January 1, 1970 GMT" as the origin for
timestamps (same as the unix time origin.) This is merely
a reference point. The actual timestamp represented can
cover the whole history of the Earth, using just 64 bits.
TIMESTAMP FORMAT:
We use a 64 bit integer to represent the timestamp.
The bits pattern is as below:
63 0
xxxx,x,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| | |
| | seconds from the ORIGIN (59 bits; good for 36 billion years)
| sign (1:after ORIGIN, 0: before ORIGIN)
type (see below)
Type:
1100: for special timestamps ("beginning", "forever",and null).
C000000000000001 = beginning (big bang)
C000000000000002 = forever (big crunch?)
C000000000000000 = NULL timestamp.
0100: a regular timestamp.
0010: a fixed span or duration (sign is meaningless here)
1111: a variable span. (to be defined -- L.Q.)
[public]
timestamp internal representation.
[public]
actual storage: 64 bits whatsoever.
[public]
constructors
[public virtual]
translate a GMT user time gregorian date into a timestamp. The user format must be exact as "Oct 09 12:23:45 1996"
[public virtual]
translates a timestamp into GMT user format, with the form of "Oct 09 12:23:45 GMT 1996". To translate GMT time into local time, use system library functions.
[public]
same as output; except in a terse format according to theunit of the timestamp.
[public virtual]
change the temporal scale of this value
[public virtual]
check if this temporal value is Earlier Than 'a'
[public virtual]
check if this temporal value is Later than 'a'
[public virtual]
check if this temporal value is during 'a'
[public virtual]
check if this temporal value overlaps 'a'
[public]
type conversion (timestamp -> int64)
[public]
convert a gregorian date into timestamp (seconds since origin.) Originally written by "MultiCal" group; modified to support hour/min/sec.
[public]
handy versionf of date2TS
[public]
Translate from seconds format to explicit Greogrian date. Original version by "MultiCal" group; modified to support hour/min/sec.
[public]
Return a time label that is in user format and in accordance to the precision. (For example, if the precision is set to year, the time label will only includ the year number, such as "1996", instead of "JAN 1 00:00:00 1996".)
[public]
set timestamp to just indicate the year.
[public]
This method turns the timestamp into a special one representing beginning of the universe (big bang). This timestamp is smaller than any other timestamp.
[public]
This turns the timestamp into a "forever" one, which is greater than any other timestamp.
[public]
This method turn the timestamp into a fixed span.
Documentation generated by lqian@lqian-sun on Wed Jul 14 09:36:10 EDT 1999 | Kdoc |