timespan functionsA 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.parsetimespan.from_daystimespan.from_days <days>
Returns a timespan object that represents a days interval
days: The days.A timespan object
input Try out
{{ (timespan.from_days 5).days }}
output
5
timespan.from_hourstimespan.from_hours <hours>
Returns a timespan object that represents a hours interval
hours: The hours.A timespan object
input Try out
{{ (timespan.from_hours 5).hours }}
output
5
timespan.from_minutestimespan.from_minutes <minutes>
Returns a timespan object that represents a minutes interval
minutes: The minutes.A timespan object
input Try out
{{ (timespan.from_minutes 5).minutes }}
output
5
timespan.from_secondstimespan.from_seconds <seconds>
Returns a timespan object that represents a seconds interval
seconds: The seconds.A timespan object
input Try out
{{ (timespan.from_seconds 5).seconds }}
output
5
timespan.from_millisecondstimespan.from_milliseconds <millis>
Returns a timespan object that represents a milliseconds interval
millis: The milliseconds.A timespan object
input Try out
{{ (timespan.from_milliseconds 5).milliseconds }}
output
5
timespan.parsetimespan.parse <text>
Parses the specified input string into a timespan object.
text: A timespan textA timespan object parsed from timespan
Note: This document was automatically generated from the source code using
Scriban.DocGen.