Skip to content

Time

The Time object represents time.

classDiagram
  direction LR
  Time --> TimeDifference
  class TimeDifference{
  }
  class Time{
    string iso8601
    TimeDifference timeDifference
    int hours
    int minutes
    int seconds
    int timeInSeconds
    string time
    string timeShort
  }

It is possible to render the time by rendering the object directly.

source
{{ time }}
output
12:30:15

Properties

Attribute name Type Description
iso8601 string The ISO 8601 formatted time string
timeDifference TimeDifference The TimeDifference object that represents the difference between 2 moments in time.
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
time string Formatted value of time
timeShort string Formatted value of time without seconds

Examples

iso8601 property

{{ time.iso8601 }}
11:12:13

timeDifference property

{% set timeA = ObjectApi.getTime("12:30:15") %}
{% set timeB = ObjectApi.getTime("13:30:15") %}

{% set diff = timeA.timeDifference(timeB) %}
{{ diff.timeInSeconds }}
3600

hours property

{% set time = ObjectApi.getTime("12:30:15") %}
{{ time.hours }}
12

minutes property

{% set time = ObjectApi.getTime("12:30:15") %}
{{ time.minutes }}
30

seconds property

{% set time = ObjectApi.getTime("12:30:15") %}
{{ time.seconds }}
15

timeInSeconds property

{% set time = ObjectApi.getTime("12:30:15") %}
{{ time.timeInSeconds }}
45015

time property

{% set time = ObjectApi.getTime("12:30:15") %}
{{ time.time }}
12:30:15

timeShort property

{% set time = ObjectApi.getTime("12:30:15") %}
{{ time.timeShort }}
12:30