ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage properties / Time and date management properties
  • Managing the seconds
  • Operators available for the seconds
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The Second property 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 codePHP Not available.
  • Modify the seconds or the number of seconds in a Date item (in "Date and Time" or "Duration" format).
    WEBDEV - Browser codePHP Not available.
Remark: The Second property simplifies time and duration offset operations.
Reminder Date fields can be used to manage:
  • 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)
Example
// Manipulations d'une variable de type DateHeure
HeureDébut is DateTime = "200112311230250"
// Ajouter 50 secondes
HeureDébut.Second += 50// Modifier les secondes
HeureDébut.Second = 50
// Manipulations d'une rubrique de type DateHeure
Travail.HeureDébut = "200112311230250"
// Ajouter 50 secondes
Travail.HeureDébut.Seconde += 50// Modifier les secondes
Travail.HeureDébut.Seconde = 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 variable of type Time, DateTime or Duration to be used.

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 variable of type Time, DateTime or Duration to be used.
<New number of seconds>: Character string or integer
New number of seconds (between 1 and 59).
WEBDEV - Browser codePHP Not available in browser code or PHP

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

<Result> = <Data file>.<Item>.Second
<Result>: Integer
Number of seconds on 2 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.
WEBDEV - Browser codePHP Not available in browser code or PHP

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

<Fichier de données>.<Rubrique>.Second = <Nouveau nombre de secondes>
<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 seconds>: Character string or integer
New number of seconds (between 1 and 59).
Remarks

Managing the seconds

  • Case 1: Direct assignment
    When assigning directly (for example, MyWork.MyDateTime.Second = n), seconds must be between 00 and 59. A WLanguage error occurs if an invalid number of seconds is specified.
    The notation MyJob.MyDateTime.Second= MyJob.MyDateTime.Second + 5 may generate a runtime error.
  • Case 2: Operations on 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 with the Second property:
  • ++ and --
  • += and -=
// Exemple sur une rubrique
Travail.DateHeureDébut = "200411261324320"
Travail.DateHeureDébut.Seconde++     // Ajouter 1 seconde
Travail.DateHeureDébut.Seconde+=5    // Ajouter 5 secondes
Travail.DateHeureDébut.Seconde-=5    // Retrancher 5 secondes
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/13/2025

Send a report | Local help