PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Declaration and initialization
  • Assigning a Time variable to a Time item
  • Properties that can be used on the times
  • Limits
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
The Time type allows you to easily handle the times. This type is used to manage the conversions almost automatically (TimeToString, TimeToInteger, ...)
This type can be used:
  • to retrieve and handle the HFSQL items in Time format.
  • to retrieve and handle the edit controls in Time format.
  • in the WLanguage functions used to manage the times.
  • to perform calculations on the times (difference, addition, ...). See Operations that can be performed on the Time type for more details.
Notes:
  • Several properties can be used with the Time type, to retrieve part of the time for example (hour, minute, ...).
  • See Declaring a variable for more details.
Versions 16 and later
Universal Windows 10 App This type of variable is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This type of variable is now available for the Windows Phone applications.
Universal Windows 10 App This type of variable is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This type of variable is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This type of variable is now available for iPhone/iPad applications.
iPhone/iPad This type of variable is now available for iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Android Widget This type of variable is now available in Android Widget mode.
New in version 18
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Android Widget This type of variable is now available in Android Widget mode.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Android Widget This type of variable is now available in Android Widget mode.
Versions 20 and later
WEBDEV - Browser code This type of variable is now available in browser code.
New in version 20
WEBDEV - Browser code This type of variable is now available in browser code.
WEBDEV - Browser code This type of variable is now available in browser code.
Versions 21 and later
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Apple Watch This type of variable is now available in Apple Watch mode.
New in version 21
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Apple Watch This type of variable is now available in Apple Watch mode.
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Apple Watch This type of variable is now available in Apple Watch mode.
Example
StartTime is Time = 1205
EndTime is Time = "2030"     // 20:30
CurrentTime is Time = TimeSys()
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 variable to declare.
<Value>:
Value that will be assigned to the variable. The type of this value can be:
  • Time
  • DateTime: only the time will be taken into account.
  • character string, in the following format:
    • HHMM
    • HHMMSS
    • HHMMSSCC
    • HHMMSSCCC
      Only the hours and the minutes will be taken into account.
      (HH: Hour, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second)
  • integer: the time will correspond to the number of hundredths of a second passed since midnight "00:00:00:00". Midnight corresponds to the integer 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.
    • character string, in the following format:
      - HHMM
      - HHMMSS
      - HHMMSSCC
      - HHMMSSCCC
      Only the hours and the minutes will be taken into account (HH: Hour, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second).
    • integer: the time will correspond to the number of hundredths of a second passed since midnight "00:00:00:00". Midnight corresponds to the integer 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.
Versions 19 and later
Note: You also have the ability to initialize a Time variable with the system time by using Now.
New in version 19
Note: You also have the ability to initialize a Time variable with the system time by using Now.
Note: You also have the ability to initialize a Time variable with the system time by using Now.

Assigning a Time variable to a Time item

From now on, when a Time variable is assigned to a Time item, the seconds and the hundreds of a second are taken into account according to the format of the item.
For example, if the Time variable corresponds to "HHMMSSCCC":
Item of the data fileUp to version 100050 of WINDEV, WEBDEV, WINDEV MobileFrom version 100050 of WINDEV, WEBDEV and WINDEV Mobile
String itemHHMMHHMMSSCCC
Time item in HHMM formatHHMMHHMM
Time item in HHMMSS formatHHMMHHMMSS
Time item in HHMMSSMM formatHHMMHHMMSSMM

Properties that can be used on the times

The following properties can be used on the times:
TimeReturns or modifies the hour (in integer format).
MillisecondReturns or modifies the number of milliseconds (in integer format).
MinuteReturns or modifies the number of minutes (in integer format).
SecondReturns or modifies the number of seconds (in integer format).
See Operations that can be performed on the Time type for more details.
StartTime is Time = "20011201"
// Adds 5 hours
StartTime..Hour += 5
// Modifies the number of minutes
StartTime..Minute = 5

Limits

The Time type is used to manage the hours found between 00:00 and 23:59. The precision is up to the millisecond.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment