← daytomonth operator page · time/daytomonth/sc/months_of_thirty_days

Months of thirty days 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

daytomonth(SC_1) with SC_1 = 134, the page's Example 3.

Manual:

Number days to duration: daytomonth (134); "returns P4M14D"; daytomonth "returns a duration having the following mask", \PM\MDD\D, "the corresponding number of months and days; according to ISO 8601 M = 30D".

Expected:

DS_r = P4M14D, a String: 134 = 4 × 30 + 14.

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 := daytomonth(SC_1);

input/scalars.csv ⇩

SC_1
134

input/scalars.json ⇩

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

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "DS_r", "type": "String", "value": "P4M14D"}
  ]
}