Flex Gateway新着情報
Governance新着情報
Monitoring API ManagerFlex Gateway新着情報
Governance新着情報
Monitoring API Manager2.x
Mule 4
3.9
1.1
2.x
1.2
7.x
変換する特定の値に一致する最初のフォーマッター
を使用して、String
値を Date
値に変換します。
DataWeave バージョン 2.5.0 で導入されました。
名前 | 型 | 説明 |
---|---|---|
|
String (文字列) |
|
|
Array<Formatter> |
|
次の例では、さまざまな入力での toDate
の動作を示します。
application/dw
形式の出力が生成されます。
%dw 2.0
import * from dw::util::Coercions
import * from dw::Runtime
output application/dw
---
{
a: toDate("2023-28-03", [{format: "yyyy/MM/dd"}, {format: "yyyy-dd-MM", locale: "en_US"}]),
b: try(() -> toDate("2023-28-03", [{format: "yyyy/MM/dd"}])).error.message
}
DataWeave
{
a: |2023-03-28| as Date {format: "yyyy-dd-MM", locale: "en_US"},
b: "Could not find a valid formatter for '2023-28-03'"
}
DataWeave
String
値を Date
値に変換して、形式とロケールを受け入れます。
DataWeave バージョン 2.4.0 で導入されました。
名前 | 説明 |
---|---|
|
|
|
|
|
使用する省略可能な ISO 3166 国コード ( |
次の例では、さまざまな入力での toDate
の動作を示します。
application/dw
形式の出力が生成されます。
%dw 2.0
import * from dw::util::Coercions
output application/dw
---
{
a: toDate("2015-10-01"),
b: toDate("2003/10/01","uuuu/MM/dd")
}
DataWeave
{
a: |2015-10-01|,
b: |2003-10-01| as Date {format: "uuuu/MM/dd"}
}
DataWeave