Skip to main content
Version: 7.9

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

    • 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 Container.Calendar.date}, 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.