このページはまだ翻訳されていません。原文の内容が表示されています。
duration
Represents a positive or negative span of time.
コンストラクタ引数引数は関数への入力値です。関数名の後に括弧で囲んで指定します。
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()

duration(,,,days:,)->定義定義これらの関数や型には、関連する定義を持たせることができます。定義にアクセスするには、対象の関数や型の名前を指定した後に、ピリオド区切りで定義名を記述します。
seconds
secondsThe 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()->minutes
minutesThe 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()->hours
hoursThe 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()->days
daysThe 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()->weeks
weeksThe 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()->