| SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST |
SysClock
| Class List | |
| Interval | The Interval is a delta time measure which can be used to increment a TimeStamp or find the time difference between two TimeStamps. |
| TimeStamp | The TimeStamp is a compressed date/time format with the advantage over the Unix time stamp of being able to represent any date/time in the SysClock.DateTime type. |
| Class Summary: Interval [Detail] | |
+--Time.Interval The Interval is a delta time measure which can be used to increment a TimeStamp or find the time difference between two TimeStamps. The maximum number of milliseconds in an interval will be the value msecPerDay. | |
| Field Summary | |
| dayInt-: LONGINT Number of days in this interval. | |
| msecInt-: LONGINT The number of milliseconds in this interval. | |
| Constructor Summary | |
| InitInterval(VAR Interval, LONGINT, LONGINT) Initialize the Interval int with days days and msecs mS. | |
| Method Summary | |
| Add(Interval) | |
| Cmp(Interval): SHORTINT Compares a to b. | |
| Fraction(Interval): LONGREAL | |
| Scale(LONGREAL) | |
| Sub(Interval) | |
| Class Summary: TimeStamp [Detail] | |
+--Time.TimeStamp The TimeStamp is a compressed date/time format with the advantage over the Unix time stamp of being able to represent any date/time in the SysClock.DateTime type. Note: TimeStamp is in UTC or local time when time zones are not supported by the local operating system. | |
| Field Summary | |
| days-: LONGINT Modified Julian days since `17 Nov 1858'. | |
| msecs-: LONGINT Milliseconds since `00:00'. | |
| Constructor Summary | |
| InitTimeStamp(VAR TimeStamp, LONGINT, LONGINT) Initialize the TimeStamp t with days days and msecs mS. | |
| Method Summary | |
| Add(Interval) Adds the interval b to the time stamp a. | |
| Cmp(TimeStamp): SHORTINT Compares a to b. | |
| Delta(TimeStamp, VAR Interval) | |
| Sub(Interval) Subtracts the interval b from the time stamp a. | |
| Procedure Summary | |
| GetTime(VAR TimeStamp) Set t to the current time of day. | |
| Constant Summary | |
| msecPerDay Number of millseconds in a day. | |
| msecPerHour Number of millseconds in an hour. | |
| msecPerMin Number of millseconds in a minute. | |
| msecPerSec Number of millseconds in a second. | |
| Class Detail: Interval |
| Field Detail |
FIELD dayInt-: LONGINT
Number of days in this interval.
FIELD msecInt-: LONGINT
The number of milliseconds in this interval. This number is from [0, msecPerDay[.
| Constructor Detail |
PROCEDURE InitInterval(VAR int: Interval;
days: LONGINT;
msecs: LONGINT)Initialize the Interval int with days days and msecs mS.
Pre-condition: msecs>=0
| Method Detail |
PROCEDURE (VAR a: Interval) Add(b: Interval)
Post-condition: a = a + b
PROCEDURE (VAR a: Interval) Cmp(b: Interval): SHORTINT
-1 a<b
0 a=b
1 a>b
This means the comparison can be directly extrapolated to a comparison between the two numbers, for example,
Cmp(a,b)<0 then a<b Cmp(a,b)=0 then a=b Cmp(a,b)>0 then a>b Cmp(a,b)>=0 then a>=b
PROCEDURE (VAR a: Interval) Fraction(b: Interval): LONGREAL
Pre-condition: b<>0
Post-condition: RETURN a/b
PROCEDURE (VAR a: Interval) Scale(b: LONGREAL)
Pre-condition: b>=0;
Post-condition: a := a*b
PROCEDURE (VAR a: Interval) Sub(b: Interval)
Post-condition: a = a - b
| Class Detail: TimeStamp |
| Field Detail |
FIELD days-: LONGINT
Modified Julian days since `17 Nov 1858'. This quantity can be negative to represent dates occuring before day zero.
FIELD msecs-: LONGINT
Milliseconds since `00:00'.
| Constructor Detail |
PROCEDURE InitTimeStamp(VAR t: TimeStamp;
days: LONGINT;
msecs: LONGINT)Initialize the TimeStamp t with days days and msecs mS.
Pre-condition: msecs>=0
| Method Detail |
PROCEDURE (VAR a: TimeStamp) Add(b: Interval)
PROCEDURE (VAR a: TimeStamp) Cmp(b: TimeStamp): SHORTINT
-1 a<b
0 a=b
1 a>b
This means the comparison can be directly extrapolated to a comparison between the two numbers, for example,
Cmp(a,b)<0 then a<b Cmp(a,b)=0 then a=b Cmp(a,b)>0 then a>b Cmp(a,b)>=0 then a>=b
PROCEDURE (VAR a: TimeStamp) Delta(b: TimeStamp;
VAR c: Interval)Post-condition: c = a - b
PROCEDURE (VAR a: TimeStamp) Sub(b: Interval)
| Procedure Detail |
PROCEDURE GetTime(VAR t: TimeStamp)
Set t to the current time of day. In case of failure (that is, if SysClock.CanGetClock() is FALSE) the time `00:00 UTC' on `Jan 1 1970' is returned. This procedure is typically much faster than doing SysClock.GetClock followed by Calendar.SetTimeStamp.
| Constant Detail |
CONST msecPerDay
Number of millseconds in a day.
CONST msecPerHour
Number of millseconds in an hour.
CONST msecPerMin
Number of millseconds in a minute.
CONST msecPerSec
Number of millseconds in a second.