← monthtoday operator page · time/monthtoday/sc/three_months_and_ten_days

Three months and ten days 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

monthtoday(SC_1) with SC_1 = P3M10D, a String, the page's Example 3.

Manual:

Duration to number days: monthtoday (P3M10D); "returns 100", "according to ISO 8601 M = 30D".

Expected:

DS_r = 100, an Integer: 3 × 30 + 10.

Team decision:

#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.

script.vtl ⇩

DS_r := monthtoday(SC_1);

input/scalars.csv ⇩

SC_1
P3M10D

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "String"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "DS_r", "type": "Integer", "value": 100}
  ]
}