File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <h3>$now function</h3>
2+ Returns the current data and time
3+
4+ <h4>Syntax</h4>
5+ <pre>$now</pre>
6+
7+ <h4>Arguments</h4>
8+ None
9+ <h4>Example</h4>
10+ <!-- Show example of function.-->
11+ <pre>$now -> 2012-07-22T13:24:57</pre>
12+
Original file line number Diff line number Diff line change 1+ <h3>Date and Time Group</h3>
2+ This group contains functions for handling date and time data.
Original file line number Diff line number Diff line change 1+ <h3>age() function</h3>
2+ Returns the difference between two dates.
3+ <br><br>
4+ The difference is returned as a <code>Interval</code>
5+ and needs to be used with one of the following functions
6+ in order to extract useful information:
7+ <pre><code>
8+ - year
9+ - month
10+ - week
11+ - day
12+ - hour
13+ - minute
14+ - second
15+ </code></pre>
16+ <h4>Syntax</h4>
17+ <code>age(string,string)</code><br>
18+ <code>age(datetime,datetime)</code><br>
19+ <code>age(string,datetime)</code><br>
20+ <code>age(datetime,string)</code><br>
21+
22+ <h4>Arguments</h4>
23+ <code>string</code> - is string. A sting in date format.
24+ <br>
25+ <code>datetime</code> - is date or datetime. A date or datetime type.
26+
27+ <h4>Example</h4>
28+ <!-- Show example of function.-->
29+ <code>age('2012-05-12','2012-05-2') -> Interval</code><br>
30+ use <code>day</code> to extract numbder of days<br>
31+ <code>day(age('2012-05-12','2012-05-2')) -> 10</code><br>
32+
Original file line number Diff line number Diff line change 1+ <h3>day() function</h3>
2+ Extract the day from a date, or the number of days
3+ from a <code>Interval</code>
4+
5+ <h4>Syntax</h4>
6+ <code>day(date)</code><br>
7+ <code>day(Interval)</code><br>
8+
9+ <h4>Arguments</h4>
10+ <code>date</code> - is date or datetime. The date to extract the day from.
11+ <br>
12+ <code>Interval</code> - is Interval. The Interval to return the number of days from.
13+
14+ <h4>Example</h4>
15+ <!-- Show example of function.-->
16+ <code>day('2012-05-12') -> 12</code><br>
17+ <code>day(tointerval('3 days')) -> 3</code><br>
18+ <code>day(age('2012-01-01','2010-01-01')) -> 730</code><br>
19+
Original file line number Diff line number Diff line change 1+ <h3>hour() function</h3>
2+ Extract the hour from a datetime or time, or the number of hours
3+ from a <code>Interval</code>
4+
5+ <h4>Syntax</h4>
6+ <code>hour(datetime)</code><br>
7+ <code>hour(Interval)</code><br>
8+
9+ <h4>Arguments</h4>
10+ <code>date</code> - is datetime or time. The date to extract the hour from.
11+ <br>
12+ <code>Interval</code> - is Interval. The Interval to return the number of hours from.
13+
14+ <h4>Example</h4>
15+ <!-- Show example of function.-->
16+ <code>hour('2012-07-22T13:24:57') -> 13</code><br>
17+ <code>hour(tointerval('3 hours')) -> 3</code><br>
18+ <code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) -> 3</code><br>
19+ <code>hour(age('2012-01-01','2010-01-01')) -> 17520</code><br>
20+
Original file line number Diff line number Diff line change 1+ <h3>minute() function</h3>
2+ Extract the minute from a datetime or time, or the number of minutes
3+ from a <code>Interval</code>
4+
5+ <h4>Syntax</h4>
6+ <code>minute(datetime)</code><br>
7+ <code>minute(Interval)</code><br>
8+
9+ <h4>Arguments</h4>
10+ <code>date</code> - is datetime or time. The date to extract the minute from.
11+ <br>
12+ <code>Interval</code> - is Interval. The Interval to return the number of minutes from.
13+
14+ <h4>Example</h4>
15+ <!-- Show example of function.-->
16+ <code>minute('2012-07-22T13:24:57') -> 24</code><br>
17+ <code>minute(tointerval('3 minutes')) -> 3</code><br>
18+ <code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) -> 20</code><br>
19+ <code>minute(age('2012-01-01','2010-01-01')) -> 1051200</code><br>
20+
Original file line number Diff line number Diff line change 1+ <h3>month() function</h3>
2+ Extract the month part from a date, or the number of months
3+ from a <code>Interval</code>
4+
5+ <h4>Syntax</h4>
6+ <code>month(date)</code><br>
7+ <code>month(Interval)</code><br>
8+
9+ <h4>Arguments</h4>
10+ <code>date</code> - is date or datetime. The date to extract the month from.
11+ <br>
12+ <code>Interval</code> - is Interval. The Interval to return the number of months from.
13+
14+ <h4>Example</h4>
15+ <!-- Show example of function.-->
16+ <code>month('2012-05-12') -> 05</code><br>
17+ <code>month(tointerval('3 months')) -> 3</code><br>
18+ <code>month(age('2012-01-01','2010-01-01')) -> 4.033...</code><br>
19+
Original file line number Diff line number Diff line change 1+ <h3>second() function</h3>
2+ Extract the seconds from a datetime or time, or the number of seconds
3+ from a <code>Interval</code>
4+
5+ <h4>Syntax</h4>
6+ <code>second(datetime)</code><br>
7+ <code>second(Interval)</code><br>
8+
9+ <h4>Arguments</h4>
10+ <code>date</code> - is datetime or time. The date to extract the second from.
11+ <br>
12+ <code>Interval</code> - is Interval. The Interval to return the number of seconds from.
13+
14+ <h4>Example</h4>
15+ <!-- Show example of function.-->
16+ <code>second('2012-07-22T13:24:57') -> 57</code><br>
17+ <code>second(tointerval('3 seconds')) -> 3</code><br>
18+ <code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) -> 1200</code><br>
19+ <code>second(age('2012-01-01','2010-01-01')) -> 63072000</code><br>
20+
Original file line number Diff line number Diff line change 1+ <h3>week() function</h3>
2+ Extract the week number from a date, or the number of weeks
3+ from a <code>Interval</code>
4+
5+ <h4>Syntax</h4>
6+ <code>week(date)</code><br>
7+ <code>week(Interval)</code><br>
8+
9+ <h4>Arguments</h4>
10+ <code>date</code> - is date or datetime. The date to extract the week from.
11+ <br>
12+ <code>Interval</code> - is Interval. The Interval to return the number of weeks from.
13+
14+ <h4>Example</h4>
15+ <!-- Show example of function.-->
16+ <code>week('2012-05-12') -> 19</code><br>
17+ <code>week(tointerval('3 weeks')) -> 3</code><br>
18+ <code>week(age('2012-01-01','2010-01-01')) -> 104.285...</code><br>
19+
Original file line number Diff line number Diff line change 1+ <h3>year() function</h3>
2+ Extract the year part from a date, or the number of years
3+ from a <code>Interval</code>
4+
5+ <h4>Syntax</h4>
6+ <code>year(date)</code><br>
7+ <code>year(Interval)</code><br>
8+
9+ <h4>Arguments</h4>
10+ <code>date</code> - is date or datetime. The date to extract the year from.
11+ <br>
12+ <code>Interval</code> - is Interval. The Interval to return the number of years from.
13+
14+ <h4>Example</h4>
15+ <!-- Show example of function.-->
16+ <code>year('2012-05-12') -> 2012</code><br>
17+ <code>year(tointerval('3 Years')) -> 3</code><br>
18+ <code>year(age('2012-01-01','2010-01-01')) -> 1.9986..</code><br>
19+
You can’t perform that action at this time.
0 commit comments