-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
192 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<h3>$now function</h3> | ||
Returns the current data and time | ||
|
||
<h4>Syntax</h4> | ||
<pre>$now</pre> | ||
|
||
<h4>Arguments</h4> | ||
None | ||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<pre>$now -> 2012-07-22T13:24:57</pre> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h3>Date and Time Group</h3> | ||
This group contains functions for handling date and time data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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: | ||
<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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h3>day() function</h3> | ||
Extract the day from a date, or the number of days | ||
from a <code>Interval</code> | ||
|
||
<h4>Syntax</h4> | ||
<code>day(date)</code><br> | ||
<code>day(Interval)</code><br> | ||
|
||
<h4>Arguments</h4> | ||
<code>date</code> - is date or datetime. The date to extract the day from. | ||
<br> | ||
<code>Interval</code> - is Interval. The Interval to return the number of days from. | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<code>day('2012-05-12') -> 12</code><br> | ||
<code>day(tointerval('3 days')) -> 3</code><br> | ||
<code>day(age('2012-01-01','2010-01-01')) -> 730</code><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<h3>hour() function</h3> | ||
Extract the hour from a datetime or time, or the number of hours | ||
from a <code>Interval</code> | ||
|
||
<h4>Syntax</h4> | ||
<code>hour(datetime)</code><br> | ||
<code>hour(Interval)</code><br> | ||
|
||
<h4>Arguments</h4> | ||
<code>date</code> - is datetime or time. The date to extract the hour from. | ||
<br> | ||
<code>Interval</code> - is Interval. The Interval to return the number of hours from. | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<code>hour('2012-07-22T13:24:57') -> 13</code><br> | ||
<code>hour(tointerval('3 hours')) -> 3</code><br> | ||
<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) -> 3</code><br> | ||
<code>hour(age('2012-01-01','2010-01-01')) -> 17520</code><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<h3>minute() function</h3> | ||
Extract the minute from a datetime or time, or the number of minutes | ||
from a <code>Interval</code> | ||
|
||
<h4>Syntax</h4> | ||
<code>minute(datetime)</code><br> | ||
<code>minute(Interval)</code><br> | ||
|
||
<h4>Arguments</h4> | ||
<code>date</code> - is datetime or time. The date to extract the minute from. | ||
<br> | ||
<code>Interval</code> - is Interval. The Interval to return the number of minutes from. | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<code>minute('2012-07-22T13:24:57') -> 24</code><br> | ||
<code>minute(tointerval('3 minutes')) -> 3</code><br> | ||
<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) -> 20</code><br> | ||
<code>minute(age('2012-01-01','2010-01-01')) -> 1051200</code><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h3>month() function</h3> | ||
Extract the month part from a date, or the number of months | ||
from a <code>Interval</code> | ||
|
||
<h4>Syntax</h4> | ||
<code>month(date)</code><br> | ||
<code>month(Interval)</code><br> | ||
|
||
<h4>Arguments</h4> | ||
<code>date</code> - is date or datetime. The date to extract the month from. | ||
<br> | ||
<code>Interval</code> - is Interval. The Interval to return the number of months from. | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<code>month('2012-05-12') -> 05</code><br> | ||
<code>month(tointerval('3 months')) -> 3</code><br> | ||
<code>month(age('2012-01-01','2010-01-01')) -> 4.033...</code><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<h3>second() function</h3> | ||
Extract the seconds from a datetime or time, or the number of seconds | ||
from a <code>Interval</code> | ||
|
||
<h4>Syntax</h4> | ||
<code>second(datetime)</code><br> | ||
<code>second(Interval)</code><br> | ||
|
||
<h4>Arguments</h4> | ||
<code>date</code> - is datetime or time. The date to extract the second from. | ||
<br> | ||
<code>Interval</code> - is Interval. The Interval to return the number of seconds from. | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<code>second('2012-07-22T13:24:57') -> 57</code><br> | ||
<code>second(tointerval('3 seconds')) -> 3</code><br> | ||
<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) -> 1200</code><br> | ||
<code>second(age('2012-01-01','2010-01-01')) -> 63072000</code><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h3>week() function</h3> | ||
Extract the week number from a date, or the number of weeks | ||
from a <code>Interval</code> | ||
|
||
<h4>Syntax</h4> | ||
<code>week(date)</code><br> | ||
<code>week(Interval)</code><br> | ||
|
||
<h4>Arguments</h4> | ||
<code>date</code> - is date or datetime. The date to extract the week from. | ||
<br> | ||
<code>Interval</code> - is Interval. The Interval to return the number of weeks from. | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<code>week('2012-05-12') -> 19</code><br> | ||
<code>week(tointerval('3 weeks')) -> 3</code><br> | ||
<code>week(age('2012-01-01','2010-01-01')) -> 104.285...</code><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h3>year() function</h3> | ||
Extract the year part from a date, or the number of years | ||
from a <code>Interval</code> | ||
|
||
<h4>Syntax</h4> | ||
<code>year(date)</code><br> | ||
<code>year(Interval)</code><br> | ||
|
||
<h4>Arguments</h4> | ||
<code>date</code> - is date or datetime. The date to extract the year from. | ||
<br> | ||
<code>Interval</code> - is Interval. The Interval to return the number of years from. | ||
|
||
<h4>Example</h4> | ||
<!-- Show example of function.--> | ||
<code>year('2012-05-12') -> 2012</code><br> | ||
<code>year(tointerval('3 Years')) -> 3</code><br> | ||
<code>year(age('2012-01-01','2010-01-01')) -> 1.9986..</code><br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters