Development build 586e1bd4
Typst文档简体中文版v0.15.1 + dev 586e1bd4

duration0.8.0起可用Go to source

Represents a positive or negative span of time.

构造函数
Question mark
0.8.0起可用Go to source

Creates a new duration.

You can specify the duration using weeks, days, hours, minutes and seconds. You can also get a duration by subtracting two datetimes.

Expand展开示例
#duration( days: 3, hours: 12, ).hours()

seconds默认值:0

The number of seconds.

minutes默认值:0

The number of minutes.

hours默认值:0

The number of hours.

days默认值:0

The number of days.

weeks默认值:0

The number of weeks.

定义
Question mark

seconds0.8.0起可用Go to source

The duration expressed in seconds.

This function returns the total duration represented in seconds as a floating-point number, rather than the seconds component of the duration.

self.seconds() → float

minutes0.8.0起可用Go to source

The duration expressed in minutes.

This function returns the total duration represented in minutes as a floating-point number, rather than the minutes component of the duration.

self.minutes() → float

hours0.8.0起可用Go to source

The duration expressed in hours.

This function returns the total duration represented in hours as a floating-point number, rather than the hours component of the duration.

self.hours() → float

days0.8.0起可用Go to source

The duration expressed in days.

This function returns the total duration represented in days as a floating-point number, rather than the days component of the duration.

self.days() → float

weeks0.8.0起可用Go to source

The duration expressed in weeks.

This function returns the total duration represented in weeks as a floating-point number, rather than the weeks component of the duration.

self.weeks() → float