mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
33 lines
855 B
Plaintext
33 lines
855 B
Plaintext
|
<h3>age() function</h3>
|
||
|
Returns the difference between two dates.
|
||
|
<br><br>
|
||
|
The difference is returned as a <code>Interval</code>
|
||
|
and needs to be used with one of the following functions
|
||
|
in order to extract useful information:
|
||
|
<pre><code>
|
||
|
- year
|
||
|
- month
|
||
|
- week
|
||
|
- day
|
||
|
- hour
|
||
|
- minute
|
||
|
- second
|
||
|
</code></pre>
|
||
|
<h4>Syntax</h4>
|
||
|
<code>age(string,string)</code><br>
|
||
|
<code>age(datetime,datetime)</code><br>
|
||
|
<code>age(string,datetime)</code><br>
|
||
|
<code>age(datetime,string)</code><br>
|
||
|
|
||
|
<h4>Arguments</h4>
|
||
|
<code>string</code> - is string. A sting in date format.
|
||
|
<br>
|
||
|
<code>datetime</code> - is date or datetime. A date or datetime type.
|
||
|
|
||
|
<h4>Example</h4>
|
||
|
<!-- Show example of function.-->
|
||
|
<code>age('2012-05-12','2012-05-2') -> Interval</code><br>
|
||
|
use <code>day</code> to extract numbder of days<br>
|
||
|
<code>day(age('2012-05-12','2012-05-2')) -> 10</code><br>
|
||
|
|