← cast operator page · general/cast/date_to_string/iso_8601_dates
pandas ✅ · DuckDB ✅
cast(Me_1, string) on a Date measure, without a mask: the default format.
Type conversion: "From date: the date value is printed using the ISO-8601 representation for dates, with the year, month and day of month fields always present."
The ISO-8601 extended form YYYY-MM-DD: 2020-01-15 and 2021-12-31.
DS_r := DS_1[calc Me_2 := cast(Me_1, string)];
| Id_1 | Me_1 |
|---|---|
| 1 | 2020-01-15 |
| 2 | 2021-12-31 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Date", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 2020-01-15 | 2020-01-15 |
| 2 | 2021-12-31 | 2021-12-31 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Me_1", "type": "Date", "role": "Measure"},
{"name": "Me_2", "type": "String", "role": "Measure"}
]
}
]
}