Script unit that provides datetime functions.
function addDays(value: datetime, days: decimal): datetime
Adds days to a date and time.
Parameters :
value: the input date and time
months: the number of days to be added. Must be an integer.
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function addHours(value: datetime, hours: decimal): datetime
Adds hours to a date and time.
Parameters :
value: the input date and time
hours: the number of hours to be added. Must be an integer.
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function addMinutes(value: datetime, minutes: decimal): datetime
Adds minutes to a date and time.
Parameters :
value: the input date and time
minutes: the number of minutes to be added. Must be an integer.
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function addMonths(value: datetime, months: decimal): datetime
Adds months to a date and time.
Parameters :
value: the input date and time
months: the number of months to be added. Must be an integer.
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function addSeconds(value: datetime, seconds: decimal): datetime
Adds seconds to a date and time. Fractions of seconds are supported with millisecond precision.
Parameters :
value: the input date and time
seconds: the number of seconds to be added. Fractions are rounded to three decimal digits.
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function addYears(value: datetime, years: decimal): datetime
Adds years to a date and time.
Parameters :
value: the input date and time
months: the number of years to be added. Must be an integer.
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function days(startValue: datetime, endValue: datetime): decimal
Returns the number of days between two date and times. This function is equivalent to days(toDate(startValue), toDate(endValue)).
Parameters :
startValue: the input start date and time
endValue: the input end date and time
Return :
the number of days or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function fromDate(value: date): datetime
Converts a date to date and time with time set to 00:00:00.
Parameters :
value: the input date
Return :
the new date and time or null if parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function fromDateAndTime(dateValue: date, timeValue: time): datetime
Creates a date and time given date and time values.
Parameters :
dateValue: the input date
timeValue: the input time
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function months(startValue: date, endValue: date): decimal
Returns the number of months between two date and times.
Parameters :
startValue: the input start date and time
endValue: the input end date and time
Return :
the number of months or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function now(): datetime
Returns current date and time.
Return :
the current date and time.
Can be used in: Script tasks, Table triggers, Function fields without search optimization
function of(year: decimal, month: decimal, day: decimal, hour: decimal, minute: decimal, second: decimal): datetime
Creates a date and time given year, month, day, hours, minutes and seconds. Fractions of seconds are supported with millisecond precision.
Parameters :
year: the input year
month: the input month
day: the input day
hour: the input hour
minute: the input minute
second: the input second. Fractions are rounded to three decimal digits.
Return :
the new date and time or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function seconds(startValue: datetime, endValue: datetime): decimal
Returns the number of seconds between two date and times. Fractions of seconds are supported with millisecond precision.
Parameters :
startValue: the input start date and time inclusive
endValue: the input end date and time exclusive
Return :
the number of seconds or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields
function years(startValue: date, endValue: date): decimal
Returns the number of full years between two date and times.
Parameters :
startValue: the input start date and time
endValue: the input end date and time
Return :
the number of years or null if any parameter is null.
Can be used in: Script tasks, Table triggers, Function fields