Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
There also exist algebraic operators (+, -) to add or subtract dates.
Year(<Date>|<String,Pattern>)
Extracts the year part of the date
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT YEAR("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 2013 |
Month(<Date>|<String,Pattern>)
Extracts the month part of the date
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT MONTH("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 12 |
Week(<Date>|<String,Pattern>)
Returns the week number of the date
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT WEEK("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 52 |
Day(<Date>|<String,Pattern>)
Extracts the day part of the date
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT DAY("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 24 |
Hour(<Date>|<String,Pattern>)
Returns the hour of the date
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT HOUR("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 5 |
Minute(<Date>|<String,Pattern>)
Returns the minute of the date
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT MINUTE("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 30 |
Second(<Date>|<String,Pattern>)
Returns the second of the date
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT SECOND("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 10 |
WeekDay(<Date>|<String,Pattern>)
Returns the week day index of the date (1
= Sunday, 2
= Monday, ..., 7
= Saturday)
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT WEEKDAY("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 3 |
DayOfMonth(<Date>|<String,Pattern>)
Synonym for day().
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT DAYOFMONTH("12/24/13 5:30:10","M/d/y h:m:s") FROM Stream
=> 24 |
Years(Date, Date)
Computes the number of years between the two dates.
Months(Date, Date)
Computes the number of months between the two dates.
Days(Date, Date)
Computes the number of days between the two dates.
Hours(Date, Date)
Computes the number of hours between the two dates.
Minutes(Date, Date)
Computes the number of minutes between the two dates.
Seconds(Date, Date)
Computes the number of seconds between the two dates.
CurDate()
Return the current system time specific date
Now()
Returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC
NanoTime()
Returns the current value of the time source, in nanoseconds.
SysDate()
Returns the current system time specific date
StreamDate()
Returns the current stream time specific date
Table of Contents |
---|