Date functions

DATEPART / DATEELEMENT

Since Process17.0.0

Description

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

Syntax

1
@DATEELEMENT( date ; "ELEMENT" )

the function contains the following arguments

Parameter Description Mandatory Comment
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)

Return value

The DATEPART finction function returns an integer number corresponding to the requested element.

Examples

Example 1: filling in a number field with the week number retrieved from the current date

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