|
|
|
|
|
- Managing the milliseconds
- Operators available for the milliseconds
Millisecond (Property) In french: Milliseconde
The Millisecond property is used to: - Retrieve the number of milliseconds from a Time, DateTime or Duration variable.
- Modify the number of milliseconds in a Time, DateTime or Duration variable.
- Retrieve the milliseconds or the number of milliseconds from a Date item (in "Date and Time" or "Duration" format).
- Modify the milliseconds or number of milliseconds in a Date item ("Date and Time" or "Duration" format).
Remark: The Millisecond property simplifies time and duration offset operations. Reminder: Date items are used to handle: - simple dates: "Year - Month - Day" (YYYYMMDD format)
- dates and times: "Year - Month - Day - Hours - Minutes - Seconds - Milliseconds" (YYYYMMDDHHmmSSCCC format)
- durations: "Number of days - Number of hours - Number of minutes - Number of seconds - Number of milliseconds" (+DHHMMSSCCC format)
HeureDébut is DateTime = "200112311230250"
HeureDébut.Millisecond += 50
HeureDébut.Millisecond = 50
Travail.HeureDébut = "200112311230250"
Travail.HeureDébut.Milliseconde += 50
Travail.HeureDébut.Milliseconde = 50
Syntax
Finding out the number of milliseconds in a DateTime or Duration variable Hide the details
<Result> = <Time>.Millisecond
<Result>: Integer Number of milliseconds on 3 digits. <Time>: DateTime or Duration Name of the variable of type Time, DateTime or Duration to be used.
Modifying the number of milliseconds in a DateTime or Duration variable Hide the details
<Time>.Millisecond = <New number of milliseconds>
<Time>: DateTime or Duration Name of the variable of type Time, DateTime or Duration to be used. <New number of milliseconds>: Character string or integer New number of milliseconds (included between 0 and 999).
Finding out the number of milliseconds in a Date item ("Date and Time" or "Duration" format) Hide the details
<Result> = <Data file>.<Item>.Milliseconds
<Result>: Integer Number of milliseconds on 3 digits. <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 is defined in the data model editor or with the Item Description type.
Modifying the number of milliseconds in a Date item ("Date and Time" or "Duration" format) Hide the details
<Fichier de données>.<Rubrique>.millisecond = <Nouveau nombre de millisecondes>
<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 number of milliseconds>: Character string or integer New number of milliseconds (between 0 and 999). Remarks Managing the milliseconds Case 1: Direct assignment When assigning directly (for example, MyWork.MyDateTime.Millisecond = n), milliseconds must be between 0 and 999. A WLanguage error occurs if a wrong number is specified. The notation MyWork.MyDateTime.Millisecond = MyWork.MyDateTime.Millisecond + 50 may generate a runtime error. Case 2: Operations on milliseconds When operations are carried out on the hours of date fields (in "Date and Time" or "Duration" format), the change of minutes is automatically managed. The addition or subtraction of milliseconds automatically takes into account the change from 999 milliseconds to 1 minute.
DateHeureDébut is DateTime = "2004112613240320"
DateHeureDébut.Millisecond += 800
Operators available for the milliseconds The following arithmetic operators can be used with the Millisecond property:
Travail.DateHeureDébut = "200411261324320"
Travail.DateHeureDébut.Milliseconde ++
Travail.DateHeureDébut.Milliseconde +=5
Travail.DateHeureDébut.Milliseconde -=5
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|