Cloud Software Group, Inc. EBX®
Documentation > Developer Guide > EBX® Script > API
Navigation modeDocumentation > Developer Guide > EBX® Script > API

Unit core.date

Script unit that provides date functions.

Methods

function addDays(value: date, days: decimal): date

Adds days to a date.

function addMonths(value: date, months: decimal): datetime

Adds months to a date.

function addYears(value: date, years: decimal): date

Adds years to a date.

function days(startValue: date, endValue: date): decimal

Returns the number of days between two dates.

function fromDatetime(value: datetime): date

Converts a date and time to a date.

function fromIsoString(value: string): date

Parses a date from a string in ISO format (yyyy-MM-dd)

function months(startValue: date, endValue: date): decimal

Returns the number of months between two dates.

function now(): date

Returns current date.

function dateOf(year: decimal, month: decimal, day: decimal): date

Creates a date given year, month and day.

function toIsoString(value: date): string

Converts a date to a string in ISO format (yyyy-MM-dd)

function years(startValue: date, endValue: date): decimal

Returns the number of full years between two dates.

addDays

function addDays(value: date, days: decimal): date

Adds days to a date.

Parameters :

value: the input date

months: the number of days to be added. Must be an integer.

Return :

the new date or null if any parameter is null.

Can be used in: 

addMonths

function addMonths(value: date, months: decimal): datetime

Adds months to a date.

Parameters :

value: the input date

months: the number of months to be added. Must be an integer.

Return :

the new date or null if any parameter is null.

Can be used in: 

addYears

function addYears(value: date, years: decimal): date

Adds years to a date.

Parameters :

value: the input date

years: the number of years to be added. Must be an integer.

Return :

the new date or null if any parameter is null.

Can be used in: 

days

function days(startValue: date, endValue: date): decimal

Returns the number of days between two dates.

Parameters :

startValue: the input start date

endValue: the input end date

Return :

the number of days or null if any parameter is null.

Can be used in: 

fromDatetime

function fromDatetime(value: datetime): date

Converts a date and time to a date. The input time part is ignored.

Parameters :

value: the input date and time

Return :

the new date or null if parameter is null.

Can be used in: 

fromIsoString

function fromIsoString(value: string): date

Parses a date from a string in ISO format (yyyy-MM-dd)

Parameters :

value: the input string

Return :

the date or null if value is null or format is not valid.

Can be used in: 

months

function months(startValue: date, endValue: date): decimal

Returns the number of months between two dates.

Parameters :

startValue: the input start date

endValue: the input end date

Return :

the number of months or null if any parameter is null.

Can be used in: 

now

function now(): date

Returns current date.

Return :

the current date.

Can be used in: 

of

function dateOf(year: decimal, month: decimal, day: decimal): date

Creates a date given year, month and day.

Parameters :

year: the input year

month: the input month

day: the input day

Return :

the new date or null if any parameter is null.

Can be used in: 

toIsoString

function toIsoString(value: date): string

Converts a date to a string in ISO format (yyyy-MM-dd)

Parameters :

value: the input date

Return :

the string or null if value is null.

Can be used in: 

years

function years(startValue: date, endValue: date): decimal

Returns the number of full years between two dates.

Parameters :

startValue: the input start date

endValue: the input end date

Return :

the number of years or null if any parameter is null.

Can be used in: 

Documentation > Developer Guide > EBX® Script > API