Date Processing Functions¶
Date functions allow manipulating date values:
FORMATDATE
: TheFORMATDATE
function is used to transform date values intostring
-type values by using a specific format. It receives the following parameters:A
string
-type value specifying the desired format to use to transform the date, for example “MM-dd-yyyy HH:mm”. This pattern follows the syntax specified by the class SimpleDateFormat of the Java API.The
date
-type value to be formatted.An optional
string
-type value specifying the name of the locale that has to be taken into account when performing the conversion.
The return value is a
string
-type value representing the date parameter with the selected format.GETDAY
: Receives an optional date-type argument and returns a long-type object that represents the day of the received date. If arguments are not received, along
-type object is created that represents the current day.GETHOUR
: Receives an optionaldate
-type argument and returns along
-type object that represents the time of the received date. If no arguments are received, along
-type object is created that represents the current time.GETMINUTE
: Receives an optionaldate
-type argument and returns along
-type object that represents the minutes of the received date. If no arguments are received, along
-type object is created that represents the current minutes.GETMILLISECOND
: Receives an optionaldate
-type argument and returns along
-type object that represents the milliseconds of the received date. If no arguments are received, along
-type object is created that represents the current milliseconds.GETMONTH
: Receives an optionaldate
-type argument and returns a long-type object that represents the month of the received date. If no arguments are received, along
-type object is created that represents the current month.GETSECOND
: Receives an optionaldate
-type argument and returns along
-type object that represents the seconds of the received date. If no arguments are received, along
-type object is created that represents the current seconds.GETYEAR
: Receives an optionaldate
-type argument and returns along
-type object that represents the year of the received date. If no arguments are received, along
-type object is created that represents the current year.NOW
: This function does not accept any input argument, and creates a newdate
-type object containing the current date.TODATE
: This allows for text strings representing dates to be converted into date-type elements. Threestring
-type arguments are given. The first represents a pattern to express dates. This pattern follows the syntax specified by the class SimpleDateFormat of the Java API. The second will be a date expressed according to that pattern. The third one is astring
-type parameter which indicates the internationalization configuration that represents the “locale” of the date to process. As a result, adate
-type element equivalent to the specified date is returned.