Command: CreateTime
- Updated2024-09-12
- 3 minute(s) read
Command: CreateTime
Command: CreateTime
Creates an object that contains the date and time with a nanoseconds resolution.
Input Parameters
iYear |
Specifies the year. |
iMonth |
Specifies the month. |
iDay |
Specifies the day. |
iHour |
Specifies the hour. |
iMinute |
Specifies the minute. |
iSecond |
Specifies the second. |
[iMillisecond] |
Specifies the millisecond. |
[iMicrosecond] |
Specifies the microsecond. |
[iNanosecond] |
Specifies the nanosecond. |
Return Parameters
| ReturnValue | The return value is a UsiTimeDisp object type. |
Examples
The following example generates a channel with time values. The command CreateTime generates a start time for the time channel with 10 time values and a step width of 1 week.
| VBScript | Python |
Dim Range, dStartTime, oStartTime, vStartTime Range = "week" Set oStartTime = CreateTime(1999,11,20,0,0,0) dStartTime = ConvertTimeType (oStartTime,eConvertDIAdemDateTime ) Call ChnGenTime ("[]/GenTimeChn_dTime", Range, dStartTime, 0, 1, "StartStepNo", 10)
The following example creates the custom property Time with a time value for the data record:
| VBScript | Python |
Call Data.Root.Properties.Add("Time", CreateTime(2004,6,17,10,0,0,0,0,0))

