Date functions

NOW

Description

This function is used to return the current date and time.

Syntax

@NOW()

It returns an date with the time.

DAY

Description

This function is used to return the day of a date.

Syntax

@DAY( date )

The function contains the following arguments:

Parameter Description Mandatory
date The date from which retrieving the day. Yes

It returns a number between 1 and 31.

MONTH

Description

This function is used to return the month of a date.

Syntax

@MONTH( date )

The function contains the following arguments:

Parameter Description Mandatory
date The date from which retrieving the month. Yes

It returns a number between 1 and 12.

YEAR

Description

This function is used to return the year of a date.

Syntax

@YEAR( date )

The function contains the following arguments:

Parameter Description Mandatory
date The date from which retrieving the year. Yes

It returns a number.

FORMATDATE

Description

This function is used to format a date.

Syntax

@FORMATDATE( date;[style];[date_style];[time_style] )

The function contains the following arguments:

Parameter Description Mandatory
date The date to format. Yes
style “datetime” to display the date and the time, “date” to display the date only, “time” to display the time only. No
date_style “medium” (January the 30th 2013), “short” (01/30/2013), “full” (Wednesday, January the 30th 2013). No
time_style “long” (hr:min:ss) or “short” (hr:min). No

It returns a string.

Examples

@FORMATDATE( @NOW();"datetime";"medium";"long" )

DAYSDIFF

Description

This function is used to calculate the difference in days between two dates (by comparing years, months and days).

Syntax

@DAYSDIFF( date1; date2 )

The function contains the following arguments:

Parameter Description Mandatory
date1 The first date to compare. Yes
date2 The second date to compare. Yes

It returns a number (< 0 if date1 is before date2 ; 0 if date1 and date2 are equals ; > 0 if date1 is after date2).

TODATE

Description

This function is used to convert integer numbers into date.

Syntax

@TODATE( [year];[month];[day];[hour];[minute];[second];[millisecon] )

The function contains the following arguments:

Parameter Description Mandatory
year The year of the date. No
month The month of the date. No
day The day of the date. No
hour The hour of the date. No
minute The minute of the date. No
second The second of the date. No
millisecon The millisecon of the date. No

It returns the date.

Examples

@TODATE( 2024;12;5;5;38 )

TOPERIOD

Description

This function is used to make a period field.

Syntax

@TOPERIOD( starting_date;ending_date )

The function contains the following arguments:

Parameter Description Mandatory
starting_date The date of the period start. Yes
ending_date The date of the period end. Yes

It returns a period.

HOURMINUTES

Description

This function is used to display a timestamp in HH:mm format.

Syntax

@HOURMINUTES( Timestamp )

The function contains the following arguments:

Parameter Description Mandatory
Timestamp The timestamp to display in hour and minutes format. Yes

It returns a string.

DATEELEMENT

Since Process17.0.0

Description

This function is used to extract a defined part from a date.

Syntax

@DATEELEMENT( date ; "ELEMENT" )

The function contains the following arguments:

Parameter Description Mandatory
date Date from which to extract the date part. Yes
ELEMENT Part to be extracted (see definition table below). Yes

Définition des éléments accessibles

Element Description
ERA The era (0-1)
YEAR The year (YYYY)
MONTH The month (0-11)
WEEK_OF_YEAR The week of the year (1-53)
WEEK_OF_MONTH The week of the month (1-6)
DAY_OF_MONTH The day of the month (1-31)
DAY_OF_YEAR The day of the year (1-366)
DAY_OF_WEEK The day of the week (1-7) (From Sunday to Saturday)
DAY_OF_WEEK_IN_MONTH The occurrence of the day in the month (e.g. 3rd Friday of the month)
HOUR The hour (0-11)
HOUR_OF_DAY The hour (0-23)
MINUTE The minutes (0-59)
SECOND The seconds (0-59)
MILLISECOND The milliseconds (0-999)

It returns an integer number corresponding to the requested element.

Examples

This example fill in a number field with the week number retrieved from the current date:

@DATEPART( @NOW() ; "WEEK_OF_YEAR" )