AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Propiedades WLanguage / Propiedades de gestión de fechas y horas
  • Managing the seconds
  • Operators available for the seconds
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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 - Código NavegadorPHP Not available.
  • Modify the seconds or the number of seconds in a Date item (in "Date and Time" or "Duration" format).
    WEBDEV - Código NavegadorPHP 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)
Ejemplo
// 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
Sintaxis

Finding out the number of seconds in a Time, DateTime or Duration variable Ocultar los detalles

<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 Ocultar los detalles

<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 - Código NavegadorPHP Not available in browser code or PHP

Finding out the number of seconds in a Date item (in "Date and Time" or "Duration" format) Ocultar los detalles

<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 - Código NavegadorPHP Not available in browser code or PHP

Modifying the number of seconds in a Date item (in "Date and Time" or "Duration" format) Ocultar los detalles

<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).
Observaciones

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 -=
// 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
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 13/05/2025

Señalar un error o enviar una sugerencia | Ayuda local