DATE
SourceDATE converts RFC3339 date time string to DateTime object.
Argument | Type | Default value | Description |
time |
String |
String in rfc3339 format. |
Returns DateTime
New datetime object derived from timestring.
DATE_ADD
SourceDATE_ADD adds amount given in unit to date. The following units are available: * y, year, year * m, month, months * w, week, weeks * d, day, days * h, hour, hours * i, minute, minutes * s, second, seconds * f, millisecond, milliseconds
Argument | Type | Default value | Description |
date |
DateTime |
Source date. | |
amount |
Int |
Amount of units | |
unit |
String |
Unit. |
Returns DateTime
Calculated date.
DATE_COMPARE
SourceDATE_COMPARE checks if two partial dates match.
Argument | Type | Default value | Description |
date1 |
DateTime |
First date. | |
date2 |
DateTime |
Second date. | |
unitRangeStart |
String |
Unit to start from. | |
unitRangeEnd |
String |
"millisecond" |
Unit to end with. error will be returned if unitrangestart unit less that unitrangeend. |
Returns Boolean
True if the dates match, else false.
DATE_DAY
SourceDATE_DAY returns the day of date as a number.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A day number.
DATE_DAYOFWEEK
SourceDATE_DAYOFWEEK returns number of the weekday from the date. Sunday is the 0th day of week.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
Number of the weekday.
DATE_DAYOFYEAR
SourceDATE_DAYOFYEAR returns the day of year number of date. The return value range from 1 to 365 (366 in a leap year).
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A day of year number.
DATE_DAYS_IN_MONTH
SourceDATE_DAYS_IN_MONTH returns the number of days in the month of date.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
Number of the days.
DATE_DIFF
SourceDATE_DIFF returns the difference between two dates in given time unit.
Argument | Type | Default value | Description |
date1 |
DateTime |
First date. | |
date2 |
DateTime |
Second date. | |
unit |
String |
Time unit to return the difference in. | |
asFloat |
Boolean |
False |
If true amount of unit will be as float. |
Returns Int
Float
Difference between date1 and date2.
DATE_FORMAT
SourceDATE_FORMAT format date according to the given format string.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime object. |
Returns String
Formatted date.
DATE_HOUR
SourceDATE_HOUR returns the hour of date as a number.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
An hour number.
DATE_LEAPYEAR
SourceDATE_LEAPYEAR returns true if date is in a leap year else false.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Boolean
Date is in a leap year.
DATE_MILLISECOND
SourceDATE_MILLISECOND returns the millisecond of date as a number.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A millisecond number.
DATE_MINUTE
SourceDATE_MINUTE returns the minute of date as a number.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A minute number.
DATE_MONTH
SourceDATE_MONTH returns the month of date as a number.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A month number.
DATE_QUARTER
SourceDATE_QUARTER returns which quarter date belongs to.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A quarter number.
DATE_SECOND
SourceDATE_SECOND returns the second of date as a number.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A second number.
DATE_SUBTRACT
SourceDATE_SUBTRACT subtract amount given in unit to date. The following units are available: * y, year, year * m, month, months * w, week, weeks * d, day, days * h, hour, hours * i, minute, minutes * s, second, seconds * f, millisecond, milliseconds
Argument | Type | Default value | Description |
date |
DateTime |
Source date. | |
amount |
Int |
Amount of units | |
unit |
String |
Unit. |
Returns DateTime
Calculated date.
DATE_YEAR
SourceDATE_YEAR returns the year extracted from the given date.
Argument | Type | Default value | Description |
date |
DateTime |
Source datetime. |
Returns Int
A year number.
NOW
SourceNOW returns new DateTime object with Time equal to time.Now().
Argument | Type | Default value | Description |
Returns DateTime
New datetime object.