The
Time property enables you to:
- Retrieve the time from a DateTime variable.
- Modify the time in a DateTime variable.
- Retrieve the time from in a Date item (in "Date and Time" format).
- Modify the time in a Date item ("Date and Time" format).
Reminder: Date items are used to manage:
- "Year - Month - Day" dates (YYYYMMDD format)
- "Year - Month - Day - Hours - Minutes - Seconds - Milliseconds" dates and times (YYYYMMDDHHmmSSCCC format)
- "Number of days - Number of hours - Number of minutes - Number of seconds - Number of milliseconds" durations (+DHHMMSSCCC format)
// Operations performed on a DateTime variable
StartDate is DateTime = "200112121515"
EndTime is Time = "1530"
// Change the time
StartDate.Time = "153050"// Modify the Time part
StartDate.Time = EndTime
// Operations performed on a DateTime item
Work.StartDate = "200112121515"
Work.EndTime = "1530"
// Change the time
Work.StartDate.Time = "153050"// Modify the Time part
Work.StartDate.Time = Work.EndTime
Syntax
Finding out the time in a DateTime variable Hide the details
<Result> = <DateTime variable>.Time
<Result>: Character string or time
Time extracted from the DateTime variable.
<DateTime variable>: DateTime
Name of the DateTime variable to be used.
Modifying the time in a DateTime variable Hide the details
<DateTime variable>.Time = <New time>
<DateTime variable>: DateTime
Name of the DateTime variable to be used.
<New time>: Character string or time or integer
New time that replaces the time of the variable used.The time format can be:
- Integer: number of hundredths of a second passed since midnight "00:00:00:00"
- HHMM
- HHMMSS
- HHMMSSCC
- HHMMSSCCC
(HH: hours, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second).
Finding out the time in a Date item (in "Date and Time" format) Hide the details
<Result> = <Data file>.<Item>.Time
<Result>: Character string or time
Time extracted from the DateTime variable.
<Data file>: Character string
Name of the data file used. This name was defined in the data model editor or with the File Description type.
<Item>: Character string
Name of the item used. This name was defined in the data model editor or with the Item Description type.
Modifying the time in a Date item (in "Date and Time" format) Hide the details
<Data file>.<item>.Time = <New time>
<Data file>: Character string
Name of the data file used. This name was defined in the data model editor or with the File Description type.
<Item>: Character string
Name of the item used. This name was defined in the data model editor or with the Item Description type.
<New time>: Character string or time or integer
New time that replaces the time of the item used. The time format can be:- Integer: number of hundredths of a second passed since midnight "00:00:00:00"
- HHMM
- HHMMSS
- HHMMSSCC
- HHMMSSCCC
(HH: hours, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second).
Remarks
The "Date" items (in "Date and Time" format) are used to manage the dates found between 01/01/0001 at 00:00 and 12/31/9999 at 23:59.