Date and Time Functions¶
The following functions are available to perform date and time manipulations:
| Function | Description |
|---|---|
| Now | Returns the current date and time. |
| Date | Returns the current date. |
| Time | Returns the current time. |
| Year | Returns the year from a datetime expression. |
| Month | Returns the month from a datetime expression. |
| Day | Returns the day from a datetime expression. |
| Hour | Returns the hour from a datetime expression. |
| Minute | Returns the minute from a datetime expression. |
| Second | Returns the second from a datetime expression. |
| Weekday | Returns an integer indicating the day of the week from a datetime expression. |
| WeekdayName | Returns the name of the day of the week from a datetime expression. |
| MonthName | Returns the name of the month from a datetime expression. |
| DataDiff | Returns the interval between two dates. |
| DateAdd | Returns a datetime with the specified interval added. |
| DatePart | Returns the specified part from a date. |
| DateSerial | Returns a date from the specified year, month, and day. |
| TimeSerial | Returns a time from the specified hour, minute, and second. |
| DateValue | Returns a date from the specified expression. |
| TimeValue | Returns a time from the specified expression. |
| InAgedToDays | Returns true if the passed date is between a number of days ago. |
| InLast4WeeksToSunday | Returns true if the passed date falls in the last four weeks ending the last Sunday. |
| InLast7Days | Returns true if the specified date expression is in the last 7 days. |
| InLastFullMonth | Returns true when the specified date is in the last full month. |
| InLastFullWeek | Returns true if the passed date is in the last full week (Sunday to Saturday). |
| InLastYearMTD | Returns true if the passed date falls in any date in the current month last year up to the current date last year. |
| InLastYearYTD | Returns true if the passed date falls in any date in the last year up to the current date last year. |
| InLeapYear | Returns whether the specified date expression resolves to a leap year or not. |
| WeekAgo | Returns a date and time minus 7 days from the specified date and time. |