- Function CurrentToMoment(Unit, ReferenceDate)
CurrentToMoment
The function CurrentToMoment
converts the current time to the
elapsed time with respect to a specific reference date.
CurrentToMoment(
Unit, ! (input) a time unit
ReferenceDate ! (input) a string expression
)
Arguments
- Unit
The time unit that is used to return the elapsed time.
- ReferenceDate
A string that holds the begin date using the fixed format for date and time, see paragraph Reference date format of the Language Reference.
Return Value
The result of
CurrentToMoment
is the elapsed time in Unit since ReferenceDate.
Example
Given the declarations:
Parameter _p_secs {
Unit: s;
}
Parameter _p_mins {
Unit: minute;
}
The code:
_p_secs := CurrentToMoment(
Unit : [s],
Referencedate : "2020-01-01 00:00:00");
_p_mins := CurrentToMoment(
Unit : [minute],
Referencedate : "2020-01-01 00:00:00");
display _p_secs, _p_mins ;
Resulted in:
_p_secs := 142691236 [s] ;
_p_mins := 2378187.267 [minute] ;
When this example was created.
See also
The function
StringToMoment
.Measure Execution Time
illustrates the use of some time functions. The purpose ofCurrentToMoment
in that post is to compute the time since a starting point.