File: age

package info (click to toggle)
qgis 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 374,696 kB
  • ctags: 66,263
  • sloc: cpp: 396,139; ansic: 241,070; python: 130,609; xml: 14,884; perl: 1,290; sh: 1,287; sql: 500; yacc: 268; lex: 242; makefile: 168
file content (32 lines) | stat: -rw-r--r-- 946 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<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:
<ul>
<li><code>year</code>
<li><code>month</code>
<li><code>week</code>
<li><code>day</code>
<li><code>hour</code>
<li><code>minute</code>
<li><code>second</code>
</ul>
<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 string 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') &rarr; Interval</code><br>
use <code>day</code> to extract number of days<br>
<code>day(age('2012-05-12','2012-05-2')) &rarr; 10</code><br>