← getmonth operator page · time/getmonth/sc/monthly_period

Monthly period 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

getmonth(SC_1) on a scalar monthly period, SC_1 = 2022M05, May 2022: the page does not say which month a longer period, such as a quarter, gives.

Manual:

Extract time period: "The operator getmonth returns the month of the given date/time period (between 1 and 12)."

Expected:

DS_r = 5, an Integer.

script.vtl ⇩

DS_r := getmonth(SC_1);

input/scalars.csv ⇩

SC_1
2022M05

input/scalars.json ⇩

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

expected/scalars.json ⇩

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