Few useful date and time functions
Below are few useful functions that helps to get the day, month, year, hour, minute and second from the date and time.
The test program that calls the AMDP method.
CURRENT_DATE – gives the current date .
EXTRACT( ) – function to get day, month or year.
Another alternative is to use
DAYOFMONTH( ) – to get the day of the month
MONTH( )– to get the month
YEAR( )– to get the year
DAYOFYEAR( )– to get the day of the year
DAYOFMONTH ( ), MONTH( ), YEAR ( )-
DAYOFMONTH ( ), MONTH( ), YEAR ( ), DAYOFYEAR( )-
CURRENT_DATE gives the current date and NEXT_DAY ( )- Function returns the very next date.
Similarly to get the HOUR,MINUTE or SECOND either the extract function or direct functions can be used.