SQL Date and Time Function in SAP HANA

SQL Date Time Function in SAP HANA:-

The SQL Date and Time Functions in SAP HANA contain something different then the SQL SERVER.Below all the SQL functions are explained one by one with examples and with syntax.

1.ADD_DAYS(d,n): Here d stands for date and n stands for the number of days you want to add into the date

2.ADD_MONTHS(d,n): Here d stands for date and n stands for the number of months you want to
add into the date

3.ADD_SECONDS(t,n): Here t stands for the time and n stands for the number of seconds

4.ADD_YEARS(d,n): Here d stands for the date and n stands for the numbers of the years.

5.CURRENT_DATE: This function returns the current local system date.

6.CURRENT_DATE: This function returns the current local system time.

7. CURRENT_TIMESTAMP:This returns the current local system timestamp information means the date as well as time also.

8.DAYNAME (d): This function returns the weekday in English for date d, which you need to pass it.

9. DAYOFMONTH (d): This function returns an integer the day of the month for date d, which you need to pass it.

10.DAYOFYEAR (d): This function returns an integer representation of the day of the year for date d, which you need to pass it.

11.DAYS_BETWEEN (d1, d2): It returns the number of days between two days d1 and d2

12.EXTRACT ({YEAR | MONTH | DAY | HOUR | MINUTE | SECOND} FROM d): This function returns the value of a specified DateTime field from date d, like you can get a year, month, day, hour, minute and second.

11. HOUR (t): This function returns an integer representation of the hour for time t.

12.LAST_DAY (d): This function returns the last day of the month that contains the date d.

14.Similarly, we can get Minute and Month from the function MINUTE AND MONTH

15. MONTHNAME(d): This function returns the name of the month in English for date d.

16. NEXT_DAY (d): This function returns the date of the next day after date d.