← dayofyear operator page · time/dayofyear/sc/april_in_a_leap_year

April in a leap year 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

dayofyear(SC_1) on a scalar date, SC_1 = 2020-04-07, from the example that the manual misplaced on the Days between two dates page, its Example 2.

Manual:

Extract time period: "The operator dayofyear returns the ordinal day within the year (between 1 and 366)"; and dayofyear (2020-04-07); "returns 98".

Expected:

DS_r = 98, an Integer: 31 + 29 (2020 is a leap year) + 31 + 7.

script.vtl ⇩

DS_r := dayofyear(SC_1);

input/scalars.csv ⇩

SC_1
2020-04-07

input/scalars.json ⇩

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

expected/scalars.json ⇩

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