|
|
|
|
|
- Declaration and initialization
- Assigning a Time variable to a Time item
- Properties that can be used with times
- Limitations
Time (Variable type) In french: Heure
The Time type allows you to easily manipulate times. This type manages conversions almost automatically ( TimeToString, TimeToInteger, etc.). This type can be used: - to get and manipulate HFSQL items in Time format.
- to get and manipulate Time Edit controls.
- in the WLanguage time management functions.
- to perform time calculations (subtraction, addition, etc.). For more details, see Operations available with the Time type.
Remarks: - Several properties can be used with the Time type to retrieve only part of the time (hour, minute, etc.).
- For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
HeureDébut is Time = 1205
HeureFin is Time = "2030"
HeureEnCours is Time = HeureSys()
Syntax
Declaring and initializing a variable Hide the details
<Variable name> is Time = <Value>
OR
<Variable name> is Time <Variable name> = <Value>
<Variable name>: Name of the variable to declare. <Value>: Value to be assigned to the variable. This value can be of type:- Time
- DateTime: only the time will be taken into account.
- String, in the following format:
- HHMM
- HHMMSS
- HHMMSSCC
- HHMMSSCCC
Only hours and minutes are taken into account. (HH: hour, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second)
- Integer: the time will then correspond to the number of hundredths of a second elapsed since midnight "00:00:00:00".. Midnight corresponds to 0. It cannot exceed 8,639,999 (24 hours - 1 hundredth of a second).
Remarks Declaration and initialization - A Time variable can be initialized with a value of the following type:
- Time
- DateTime: only the time will be taken into account.
- String, in the following format:
- HHMM - HHMMSS - HHMMSSCC - HHMMSSCCC Only hours and minutes are taken into account (HH: hours, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second). - Integer: the time will then correspond to the number of hundredths of a second elapsed since midnight "00:00:00:00".. Midnight corresponds to 0. It cannot exceed 8,639,999 (24 hours - 1 hundredth of a second).
- By default, a Time variable is initialized with the system time. To define the default value assigned to the Date, Time and DateTime variables, use DateTimeByDefault.
Note: It is also possible to initialize a variable of type Heure with the system time using the Now function.. Assigning a Time variable to a Time item When a Time variable is assigned to a Time item, seconds and hundreds of a second are now taken into account according to the format of the item. For example, if the Time variable corresponds to "HHMMSSCCC": | | | Data file item | Up to version 100050 of WINDEV, WEBDEV, WINDEV Mobile | From version 100050 of WINDEV, WEBDEV and WINDEV Mobile | String item | HHMM | HHMMSSCCC | Time item in HHMM format | HHMM | HHMM | Time item in HHMMSS format | HHMM | HHMMSS | Time item in HHMMSSMM format | HHMM | HHMMSSMM |
Properties that can be used with times The following properties can be used with times: | | Time | Returns or modifies an integer representing an hour. | Millisecond | Returns or modifies an integer representing the number of milliseconds. | Minute | Returns or modifies an integer representing the number of minutes. | Second | Returns or modifies an integer representing the number of seconds. |
For more details, see Operations available with the Time type. HeureDébut is Time = "20011201"
HeureDébut.Heure += 5
HeureDébut.Minute = 5
The Time type is used to manage hours between 00:00 and 23:59. The precision is up to the millisecond.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|