PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Managing the milliseconds
  • Operators available for the milliseconds
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
..Millisecond 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).
    WEBDEV - Browser code Not available.
  • Modify the milliseconds or number of milliseconds in a Date item ("Date and Time" or "Duration" format).
    WEBDEV - Browser code Not available.
Note: ..Millisecond is used to simplify the operations performed on the times and durations.
Reminder: The Date items are used to manage:
  • the simple dates "Year - Month - Day" (YYYYMMDD format)
  • the dates and times "Year - Month - Day - Hours - Minutes - Seconds - Milliseconds" (YYYYMMDDHHMMSSLLL format)
  • the durations "Number of days - Number of hours - Number of minutes - Number of seconds - Number of milliseconds" (+DHHMMSSLLL format)
Versions 16 and later
Universal Windows 10 App This property is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This property is now available for the Windows Phone applications.
Universal Windows 10 App This property is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This property is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This property is now available for the iPhone/iPad applications.
iPhone/iPad This property is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This property is now available in Windows Store Apps mode.
New in version 18
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Versions 20 and later
WEBDEV - Browser code This property is now available in browser code for the Time, DateTime or Duration variables.
New in version 20
WEBDEV - Browser code This property is now available in browser code for the Time, DateTime or Duration variables.
WEBDEV - Browser code This property is now available in browser code for the Time, DateTime or Duration variables.
Versions 21 and later
Apple Watch This property is now available in Apple Watch mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This property is now available in Apple Watch mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Apple Watch This property is now available in Apple Watch mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Example
// Example on a variable
StartTime is DateTime = "200112311230250"
// Add 50 milliseconds
StartTime..Millisecond += 50 // StartTime corresponds to 200112311230300
// Modifies the number of milliseconds
StartTime..Millisecond = 50
// Example on an item
Work.StartTime= "200112311230250"
// Add 50 milliseconds
Work.StartTime..Millisecond += 50// StartTime corresponds to 200112311230300
// Modifies the number of milliseconds
Work.StartTime..Millisecond = 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 Time, DateTime or Duration variable to use.

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 Time, DateTime or Duration variable to use.
<New Number of Milliseconds>: Character string or integer
New number of milliseconds (included between 0 and 999).
WEBDEV - Browser code Not available in browser code

Finding out the number of milliseconds in a Date item ("Date and Time" or "Duration" format) Hide the details

<Result> = <File Name>.<Item Name>..Millisecond
<Result>: Integer
Number of milliseconds on 3 digits.
<File Name>: Character string (with or without quotes)
Name of data file used. This name was defined in the data model editor or by the File Description type.
<Item Name>: Character string (with or without quotes)
Name of item used. This name was defined in the data model editor or by the Item Description type.
WEBDEV - Browser code Not available in browser code

Modifying the number of milliseconds in a Date item ("Date and Time" or "Duration" format) Hide the details

<File Name>.<Item Name>..Millisecond = <New Number of Milliseconds>
<File Name>: Character string (with or without quotes)
Name of data file used. This name was defined in the data model editor or by the File Description type.
<Item Name>: Character string (with or without quotes)
Name of item used. This name was defined in the data model editor or by the Item Description type.
<New Number of Milliseconds>: Character string or integer
New number of milliseconds (included between 0 and 999).
Remarks

Managing the milliseconds

Case 1: Direct assignment
During a direct assignment (for example, MyWork.MyDateTime..Millisecond = n), the milliseconds must be included between 0 and 999. A WLanguage error occurs if a wrong number is specified.
The following notation MyWork.MyDateTime..Millisecond = MyWork.MyDateTime..Millisecond + 50 may generate a runtime error.
Case 2: Operations on the milliseconds
When performing operations on the hours found in the Date items ("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.
// Example on a variable
StartDateTime is DateTime = "2004112613240320"        // 26/11/2004 13:24:03:20
StartDateTime..Millisecond += 800                        // 26/11/2004 13:24:04:00

Operators available for the milliseconds

The following arithmetic operators can be used by ..Millisecond:
  • ++ and --
  • += and -=
// Example on an item
Work.StartDateTime = "200411261324320"
Work.StartDateTime..Millisecond++        // Add 1 millisecond
Work.StartDateTime..Millisecond+=5        // Add 5 milliseconds
Work.StartDateTime..Millisecond-=5        // Subtract 5 milliseconds
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment