system.date.setTime
This function is used in Python Scripting.
Descriptionβ
Takes in a date, and returns a copy of it with the time fields set as specified.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.date.setTime(date, hour, minute, second)
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| Date | date | The starting date. |
| Integer | hour | The hours (0-23) to set. |
| Integer | minute | The minutes (0-59) to set. |
| Integer | second | The seconds (0-59) to set. |
Returnsβ
Date - A new date, set to the appropriate time.
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
Code Snippet
# This example will set the date object to the current date with the time set to 01:37 in the morning and 44 seconds.
date = system.date.getDate(2018, 6, 29) #getDate is zero based, so a month parameter of 6 will return July.
print system.date.setTime(date, 1, 37, 44) #This will print Sun July 29 01:37:44 PDT 2018