2015-06-11 12:02:27 +10:00
|
|
|
{
|
2015-09-20 17:12:43 +02:00
|
|
|
"name": "to_interval",
|
|
|
|
"type": "function",
|
2020-07-02 01:46:48 +01:00
|
|
|
"groups": ["Conversions", "Date and Time"],
|
2020-08-02 09:53:34 +02:00
|
|
|
"description": "Converts a string to an interval type. Can be used to take days, hours, month, etc of a date.",
|
2015-06-11 12:02:27 +10:00
|
|
|
"arguments": [ {"arg":"string","description":"a string representing an interval. Allowable formats include {n} days {n} hours {n} months."}],
|
2020-10-04 15:49:17 +02:00
|
|
|
"examples": [
|
|
|
|
{ "expression":"to_interval('1 day 2 hours')", "returns":"interval: 1.08333 days"},
|
|
|
|
{ "expression":"to_interval( '0.5 hours' )", "returns":"interval: 30 minutes"},
|
|
|
|
{ "expression":"to_datetime('2012-05-05 12:00:00') - to_interval('1 day 2 hours')", "returns":"2012-05-04T10:00:00"}
|
2015-06-11 12:02:27 +10:00
|
|
|
]
|
|
|
|
}
|