2015-06-11 12:02:27 +10:00
|
|
|
{
|
2015-09-20 17:12:43 +02:00
|
|
|
"name": "week",
|
|
|
|
"type": "function",
|
2020-07-02 01:46:48 +01:00
|
|
|
"groups": ["Date and Time"],
|
2019-09-27 08:48:43 +02:00
|
|
|
"description": "Extracts the week number from a date, or the number of weeks from an interval.",
|
2022-01-13 08:56:17 -05:00
|
|
|
"variants": [{
|
|
|
|
"variant": "Date variant",
|
|
|
|
"variant_description": "Extracts the week number from a date or datetime.",
|
|
|
|
"arguments": [{
|
|
|
|
"arg": "date",
|
|
|
|
"description": "a date or datetime value"
|
|
|
|
}],
|
|
|
|
"examples": [{
|
|
|
|
"expression": "week('2012-05-12')",
|
|
|
|
"returns": "19"
|
|
|
|
}]
|
|
|
|
}, {
|
|
|
|
"variant": "Interval variant",
|
|
|
|
"variant_description": "Calculates the length in weeks of an interval.",
|
|
|
|
"arguments": [{
|
|
|
|
"arg": "interval",
|
|
|
|
"description": "interval value to return number of months from"
|
|
|
|
}],
|
|
|
|
"examples": [{
|
|
|
|
"expression": "week(to_interval('3 weeks'))",
|
|
|
|
"returns": "3"
|
|
|
|
}, {
|
|
|
|
"expression": "week(age('2012-01-01','2010-01-01'))",
|
|
|
|
"returns": "104.285"
|
|
|
|
}]
|
|
|
|
}],
|
|
|
|
"tags": ["weeks", "week", "date", "extracts", "interval", "number"]
|
2015-06-11 12:02:27 +10:00
|
|
|
}
|