PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Managing the seconds
  • Operators available for the seconds
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
..Second is used to:
  • Retrieve the number of seconds from a Time, DateTime or Duration variable.
  • Modify the number of seconds in a Time, DateTime or Duration variable.
  • Retrieve the seconds or the number of seconds from a Date item (in "Date and Time" or "Duration" format).
    WEBDEV - Browser code Not available.
  • Modify the seconds or the number of seconds in a Date item (in "Date and Time" or "Duration" format).
    WEBDEV - Browser code Not available.
Note: ..Second 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
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.
New in version 21
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.
Apple Watch This property is now available in Apple Watch mode.
Example
// Operations performed on a DateTime variable
StartTime is DateTime = "200112311230250"
// Add 50 seconds
StartTime..Second += 50// Modify the seconds
StartTime..Second = 50
// Operations performed on a DateTime item
Work.StartTime = "200112311230250"
// Add 50 seconds
Work.StartTime..Second += 50// Modify the seconds
Work.StartTime..Second = 50
Syntax

Finding out the number of seconds in a Time, DateTime or Duration variable Hide the details

<Result> = <Time>..Second
<Result>: Integer
Number of seconds on 2 digits.
<Time>: DateTime or Duration
Name of the Time, DateTime or Duration variable to use.

Modifying the number of seconds in a Time, DateTime or Duration variable Hide the details

<Time>..Second = <New number of seconds>
<Time>: DateTime or Duration
Name of the Time, DateTime or Duration variable to use.
<New number of seconds>: Character string or integer
New number of seconds (between 1 and 59).
WEBDEV - Browser code Not available in browser code

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

<Result> = <File name>.<Item name>..Second
<Result>: Integer
Number of seconds on 2 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 seconds in a Date item (in "Date and Time" or "Duration" format) Hide the details

<File name>.<Item name>..Second = <New number of seconds>
<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 seconds>: Character string or integer
New number of seconds (between 1 and 59).
Remarks

Managing the seconds

  • Case 1: Direct assignment
    During a direct assignment (for example, MyWork.MyDateTime..Second = n), the seconds must be found between 00 and 59. A WLanguage error occurs if an invalid number of seconds is specified.
    The notation MyWork.MyDateTime..Second= MyWork.MyDateTime..Second + 5 may generate a runtime error.
  • Case 2: Operations on the seconds
    When performing operations on the Date items (in 'Date and Time' or 'Duration' format), the seconds are included between 00 and 59. The addition or the subtraction of seconds automatically takes into account the changes from 59 seconds to 1 minute.

Operators available for the seconds

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