← monthtoday operator page · time/monthtoday/comp/iso_month_and_day_durations
pandas ✅ · DuckDB ✅
monthtoday(Me_1) inside calc, on durations written as the manual writes them, P2M5D, P12M0D and P0M15D, in a String Me_1.
Duration to number days: monthDuration is "a duration having the following mask", \PM\MDD\D, and the days are counted "according to ISO 8601 M = 30D", as in Example 3, where monthtoday (P3M10D); "returns 100".
Me_2 is 65 (2 × 30 + 5), 360 (12 × 30) and 15, Integers.
#394: a Duration holds only a period indicator (A, S, Q, M, W, D), so the ISO 8601 durations that daytoyear and daytomonth return and yeartoday and monthtoday take are Strings.
DS_r := DS_1[calc Me_2 := monthtoday(Me_1)];
| Id_1 | Me_1 |
|---|---|
| G | P2M5D |
| H | P12M0D |
| T | P0M15D |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| G | P2M5D | 65 |
| H | P12M0D | 360 |
| T | P0M15D | 15 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "String", "role": "Measure"},
{"name": "Me_2", "type": "Integer", "role": "Measure"}
]
}
]
}