注意 当サイトは、Typst v0.11.1 公式ドキュメントを、日本語コミュニティが非公式に翻訳したものです。誤訳・未訳・古い情報が含まれている可能性があるため、公式ドキュメント との併用を推奨します。このサイトの内容に誤りを発見された方は、GitHubリポジトリまでご報告を頂けましたら幸いです。我々のコミュニティにご興味のある方は、ぜひ非公式Discordサーバー「くみはんクラブ」にご参加ください。
Warning: This site provides an unofficial translation of the Typst v0.11.1 documentation by the Japanese Community. Please note that there may be some inaccuracies, untranslated sections or outdated information. We highly recommend referring to the latest official documentation as well. If you find any errors in the content, please let us know through our GitHub repository. If you are interested in our community, feel free to join our unofficial Discord server, “Kumihan Club.”
Typst ドキュメント日本語版

duration

Represents a positive or negative span of time.

Constructor
If a type has a constructor, you can call it like a function to create a new value of the type.

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.

#duration(
  days: 3,
  hours: 12,
).hours()
Preview

seconds
int

The number of seconds.

Default:0

minutes
int

The number of minutes.

Default:0

hours
int

The number of hours.

Default:0

days
int

The number of days.

Default:0

weeks
int

The number of weeks.

Default:0

Definitions
Functions and types and can have associated definitions. These are accessed by specifying the function or type, followed by a period, and then the definition's name.

seconds

The duration expressed in seconds.

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

self.seconds(
) -> float

minutes

The duration expressed in minutes.

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

self.minutes(
) -> float

hours

The duration expressed in hours.

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

self.hours(
) -> float

days

The duration expressed in days.

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

self.days(
) -> float

weeks

The duration expressed in weeks.

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

self.weeks(
) -> float