Skip to main content
Version: 8.1

setTime

This function is used by Ignition's Expression language.

Description​

Takes in a date, and returns a copy of it with the time fields set as specified. Note that the millisecond field is not preserved.

Syntax​

setTime(date, hour, minute, second)

Parameters​

TypeParameterDescription
DatedateA starting date.
IntegerhourThe value to set the hour field to.
IntegerminuteThe value to set the minute field to.
IntegersecondThe value to set the second field to.

Returns​

Date - A new date with the time fields set as specified. The millisecond field is not preserved.

Examples​

Code Snippet
setTime({Root Container.Calendar.date}, 1, 37, 44) //This example will set the date object to the current date with the time set to 01:37:44.