%dw 2.0
import * from dw::util::Coercions
output application/dw
---
{
  a: toDate("2015-10-01"),
  b: toDate("2003/10/01","uuuu/MM/dd")
}
toDate
toDate(str: String, format: String | Null = null, locale: String | Null = null): Date
Transforms a String value into a Date value
and accepts a format and locale.
Introduced in DataWeave version 2.4.0.
Parameters
| Name | Description | 
|---|---|
  | 
The   | 
  | 
The formatting to use on the   | 
  | 
Optional ISO 3166 country code to use, such as   | 



