Time
Calling Sequence
Parameters
Options
Description
Methods
Time Arithmetic
Examples
Compatibility
Time()
Time( d )
d
-
Date; a Date object
expr
numeric; a clock value, in multiples of the precision from the clock epoch
clock : Clock; a Clock object
moment : numeric
A Time object represents an exact moment of time with respect to a particular time scale, defined by an associated Clock.
Time objects are created by Clock objects by invoking their Now methods, but can also be created from Date objects, or through arithmetic using existing Time objects. In addition, a Time object can be created by a direct constructor call, as above; however, users will not ordinarily need to use a Time constructor call.
If called without arguments, the Time() command returns an Time object representing the current time on the default clock, the system "UTC" clock. (See Clock.)
An expression of the form Time( d ), with d a Date object converts the Date object to a Time object representing the same moment in time, with respect to the system UTC clock.
In addition, you can create a Time object explicitly by passing the 'moment' = expr option, which creates a Time object representing expr multiples of the precision of the clock from the epoch. By default, the clock associated with the Time object is the system UTC clock, but the 'clock' = c option can be passed to specify a different Clock object.
The moment and clock options are not used when the Time object constructor is called with a Date object as argument.
The following utility methods are supported by Time objects.
Epoch the epoch of the time system
Value the count value for this Time object
GetClock returns the clock associated with this Time object
Precision return the precision of the clock associated with this Time object
Time objects may be added and subtracted, and can be compared by using the < and <= operators.
It is an error to attempt to form arithmetic combinations of Time objects with incompatible clocks. Suppose that t1 and t2 are Time objects. Then the clocks of t1 and t2 are compatible if both have defined epochs or, if both have undefined epochs, and their clocks are identical.
Only affine combinations of Time objects evaluate to a Time object. Convex combinations of Time objects evaluate to an expression of the form nu, where n is numeric, and u is a unit expressing the precision of the Time objects involved.
t≔Time⁡
t≔<Time: 1970-01-01T00:00:00 + 1709272593173 ms>
type⁡t,Time
true
Precision⁡t
millisecond
Value⁡t
1709272593173
t1≔Now⁡ProcessClock
t1≔<Time: 253820845 nanosecond>
Use up some CPU time.
int⁡sin⁡x4,x:
t2≔Now⁡ProcessClock
t2≔<Time: 559862627 nanosecond>
evalb⁡t1<t2
type⁡t1+t22,Time
Precision⁡t2
nanosecond
t≔Time⁡Date⁡
t≔<Time: 1970-01-01T00:00:00 + 1709272593647 ms>
GetClock⁡t
<System UTC Clock: Host = rdubtroll4.maplesoft.com>
The Time command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
See Also
Calendar
Clock
Date
Download Help Document