Flex Gateway新着情報
Governance新着情報
Monitoring API Manager日数、時間数、分数、または秒数を表す Period (期間) 値を作成します。
DataWeave バージョン 2.4.0 で導入されました。
名前 | 説明 |
---|---|
|
|
次の例では、さまざまな入力での duration
の動作を示します。
%dw 2.0
import * from dw::core::Periods
output application/json
---
{
dayAfterDateTime: |2020-10-05T20:22:34.385Z| + duration({days: 1}),
dayAndHourBeforeDateTime: |2020-10-05T20:22:34.385Z| - duration({days: 1, hours: 1}),
pointInTimeBefore: |2020-10-05T20:22:34.385Z| - duration({days: 1, hours: 1, minutes: 20, seconds: 10}),
emptyDuration: duration({}),
constructDuration: duration({days:4, hours:11, minutes:28}),
selectHoursFromDuration: duration({days:4, hours:11, minutes:28}).hours,
decimalAsPeriod: duration({seconds: 30.5}),
addNegativeValue: duration({ minutes : 1 }) + duration({ seconds : -1 })
}
{
"dayAfterDateTime": "2020-10-06T20:22:34.385Z",
"dayAndHourBeforeDateTime": "2020-10-04T19:22:34.385Z",
"pointInTimeBefore": "2020-10-04T19:02:24.385Z",
"emptyDuration": "PT0S",
"constructDuration": "PT107H28M",
"selectHoursFromDuration": 11,
"decimalAsPeriod": "PT30.5S",
"addNegativeValue": 59
}