← yeartoday operator page · time/yeartoday/sc/one_year_and_twenty_days

One year and twenty days 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

yeartoday(SC_1) with SC_1 = P1Y20D, a String, the page's Example 2.

Manual:

Duration to number days: yeartoday (P1Y20D); "returns 385", "according to ISO 8601 Y = 365D".

Expected:

DS_r = 385, an Integer: 365 + 20.

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

input/scalars.csv ⇩

SC_1
P1Y20D

input/scalars.json ⇩

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

expected/scalars.json ⇩

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