TimeDifference¶
The TimeDifference object represents time difference between 2 points in time.
classDiagram
direction LR
class TimeDifference{
bool isNegative
int days
int hours
int minutes
int seconds
int timeInSeconds
string difference
string differenceLong
string differenceShort
}
It is possible to render the time by rendering the object directly.
source
{% set event = ObjectApi.getDateTime("2022-09-10 12:30:15") %}
{% set time = ObjectApi.getDateTime("2022-09-12 14:45:45") %}
{% set timeDifference = time.timeDifference(event) %}
{{ timeDifference }}
Properties¶
Attribute name | Type | Description |
---|---|---|
isNegative | bool |
Returns true if difference in seconds is lower than zero |
days | int |
Number of days |
hours | int |
Number of hours |
minutes | int |
Number of minutes (from 0 to 59) |
seconds | int |
Number of seconds (from 0 to 59) |
timeInSeconds | int |
Time representation in seconds |
difference | string |
Formatted value of time difference |
differenceLong | string |
Formatted full value of time difference |
differenceShort | string |
Formatted short value of time difference |