Date and Time functions in the Factory

Date/time functions extract, transform or add elements to times or dates.

Rulex Platform formula

Function

Formula

Description

addMonth

addMonth(date, nmonth)

Adds a given number of months to a date attribute.

addQuarter

addQuarter(date, nquarter)

Adds a given number of quarters to a date attribute.

addWorkingDays

addWorkingDays(date, nday)

Adds a given number of working days (excluding weekends) to a date attribute.

addYear

addYear(date, nyear)

Adds a given number of years to a date attribute.

currDate

currDate(utc)

Returns the current date according to local or UTC settings.

currDatetime

currDatetime(utc)

Returns the current datetime according to local or UTC settings.

date

date(year, month, day)

Returns a column with all values equal to the date consisting of given year, month and day. This description is valid only when the formula is filled with the year mandatory parameter and at least one optional parameter.

datetime

datetime(date, time)

Returns in each row of the result the datetime value obtained by the composition of the date value contained in the date entry and the time value contained in the time entry.

day

day(date)

Returns the day value of the date.

hour

hour(time)

Returns the hour value of time.

isDate

isDate(string, binary)

Checks whether the data type of the attribute specified in the string parameter is date.

isDatetime

isDatetime(string, binary)

Checks whether the data type of the attribute specified in the string parameter is date.

isMonth

isMonth(string, binary)

Checks whether the data type of the attribute specified in the string parameter is month.

isQuarter

isQuarter(string, binary)

Checks whether the data type of the attribute specified in the string parameter is quarter.

isTime

isTime(string, binary)

Checks whether the data type of the attribute specified in the string parameter is time.

isWeek

isWeek(string, binary)

Checks whether the data type of the attribute specified in the string parameter is week.

minute

minute(time)

Returns the minute value of time.

month

month(date, extract)

Returns the month value of date.

quarter

quarter(date, extract)

Returns the quarter value of date. If extract is True, it tries to cast variable date to quarter.

second

second(time)

Returns the seconds (values) of the time values.

time

time(hour, minute, second)

Composes a time starting from hours, minutes and seconds.

timeZone

timeZone()

Returns the current timezone, i.e. the difference between local time and UTC time. The resulting type is time.

week

week(date, extract)

Returns the week integer value of an attribute containing a value which can reconduct to a date.

weekDay

weekDay(date, mondaystart)

Returns the day of the week as an integer for each value of date.

year

year(date)

Returns the year value of an attribute containing a date.

Parameters in bold are mandatory.