← dateadd operator page · time/dateadd/sc_date/one_year_later

One year later 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

dateadd(SC_1, 1, "A") with SC_1 = 2020-02-10: one year added to a date.

Manual:

Add time unit to date: "adding years to a given date returns the date plus integer years; for years the “Y” is used", and "dateadd (2020-02-10, 1, “Y”) gives 2021-02-10".

Expected:

DS_r = 2021-02-10, a Date, the page's result.

Adaptation:

The year is written A, not the page's “Y”: VTL prescribes no representation of durations, and the chapter's list of period indicators gives A for a year and says that "each VTL system can personalize the representation of time, date, time_period and duration as desired". vtlengine's docs/data_types.rst gives the same codes for Duration, and the manual's default conversion from string to duration (Type conversion) reads A, S, Q, M, W or D.

script.vtl ⇩

DS_r := dateadd(SC_1, 1, "A");

input/scalars.csv ⇩

SC_1
2020-02-10

input/scalars.json ⇩

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

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "DS_r", "type": "Date", "value": "2021-02-10"}
  ]
}