Skip to main content
Version: 7.9


This function is used by Ignition's Expression language.


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.


setTime(date, hour, minute, second)

  • Parameters

    • Date date - A starting date.

    • int hour - The value to set the hour field to.

    • int minute - The value to set the minute field to.

    • int second - The value to set the second field to.

  • Results

    • Date - The new date with the time set as specified.

Code Examples

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