Timespan functions
A timespan object represents a time interval.
| Name | Description |
|---|---|
.days | Gets the number of days of this interval |
.hours | Gets the number of hours of this interval |
.minutes | Gets the number of minutes of this interval |
.seconds | Gets the number of seconds of this interval |
.milliseconds | Gets the number of milliseconds of this interval |
.total_days | Gets the total number of days in fractional part |
.total_hours | Gets the total number of hours in fractional part |
.total_minutes | Gets the total number of minutes in fractional part |
.total_seconds | Gets the total number of seconds in fractional part |
.total_milliseconds | Gets the total number of milliseconds in fractional part |
timespan.from_daystimespan.from_hourstimespan.from_minutestimespan.from_secondstimespan.from_millisecondstimespan.parse
timespan.from_days
timespan.from_days <days>Description
Returns a timespan object that represents a days interval
Arguments
days: The days.
Returns
A timespan object
Examples
input
{{ (timespan.from_days 5).days }}output
5timespan.from_hours
timespan.from_hours <hours>Description
Returns a timespan object that represents a hours interval
Arguments
hours: The hours.
Returns
A timespan object
Examples
input
{{ (timespan.from_hours 5).hours }}output
5timespan.from_minutes
timespan.from_minutes <minutes>Description
Returns a timespan object that represents a minutes interval
Arguments
minutes: The minutes.
Returns
A timespan object
Examples
input
{{ (timespan.from_minutes 5).minutes }}output
5timespan.from_seconds
timespan.from_seconds <seconds>Description
Returns a timespan object that represents a seconds interval
Arguments
seconds: The seconds.
Returns
A timespan object
Examples
input
{{ (timespan.from_seconds 5).seconds }}output
5timespan.from_milliseconds
timespan.from_milliseconds <millis>Description
Returns a timespan object that represents a milliseconds interval
Arguments
millis: The milliseconds.
Returns
A timespan object
Examples
input
{{ (timespan.from_milliseconds 5).milliseconds }}output
5timespan.parse
timespan.parse <text>Description
Parses the specified input string into a timespan object.
Arguments
text: A timespan text
Returns
A timespan object parsed from timespan