← daytoyear operator page · time/daytoyear/sc/years_of_365_days
pandas ✅ · DuckDB ✅
daytoyear(SC_1) with SC_1 = 782, the page's Example 2.
Number days to duration: daytoyear (782); "returns P2Y52D"; daytoyear "returns a duration having the following mask", \PY\YDDD\D, "the corresponding number of years and days; according to ISO 8601 Y = 365D".
DS_r = P2Y52D, a String: 782 = 2 × 365 + 52.
#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.
DS_r := daytoyear(SC_1);
| SC_1 |
|---|
| 782 |
{
"scalars": [
{"name": "SC_1", "type": "Integer"}
]
}
{
"scalars": [
{"name": "DS_r", "type": "String", "value": "P2Y52D"}
]
}