ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Time and date management properties
  • Range of dates
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The Time property enables you to:
  • Retrieve the time from a DateTime variable.
  • Modify the time in a DateTime variable.
  • Retrieve the time from in a Date item (in "Date and Time" format).
    WEBDEV - Browser codePHP Not available.
  • Modify the time in a Date item ("Date and Time" format).
    WEBDEV - Browser codePHP Not available.
Reminder: Date items are 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
// Operations performed on a DateTime variable
StartDate is DateTime = "200112121515"
EndTime is Time = "1530"
// Change the time
StartDate.Time = "153050"// Modify the Time part
StartDate.Time = EndTime
// Operations performed on a DateTime item
Work.StartDate = "200112121515"
Work.EndTime = "1530"
// Change the time
Work.StartDate.Time = "153050"// Modify the Time part
Work.StartDate.Time = Work.EndTime
Syntax

Finding out the time in a DateTime variable Hide the details

<Result> = <DateTime variable>.Time
<Result>: Character string or time
Time extracted from the DateTime variable.
<DateTime variable>: DateTime
Name of the DateTime variable to be used.

Modifying the time in a DateTime variable Hide the details

<DateTime variable>.Time = <New time>
<DateTime variable>: DateTime
Name of the DateTime variable to be used.
<New time>: Character string or time or integer
New time that replaces the time of the variable used.
The time format can be:
  • Integer: number of hundredths of a second passed since midnight "00:00:00:00"
  • HHMM
  • HHMMSS
  • HHMMSSCC
  • HHMMSSCCC
(HH: hours, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second).
WEBDEV - Browser codePHP Not available in browser code and in PHP

Finding out the time in a Date item (in "Date and Time" format) Hide the details

<Result> = <Data file>.<Item>.Time
<Result>: Character string or time
Time extracted from the DateTime variable.
<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 and in PHP

Modifying the time in a Date item (in "Date and Time" format) Hide the details

<Data file>.<item>.Time = <New time>
<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 time>: Character string or time or integer
New time that replaces the time of the item used. The time format can be:
  • Integer: number of hundredths of a second passed since midnight "00:00:00:00"
  • HHMM
  • HHMMSS
  • HHMMSSCC
  • HHMMSSCCC
(HH: hours, MM: minutes, SS: seconds, CC: hundredths of a second, CCC: thousandths of a second).
Remarks

Range of dates

The "Date" items (in "Date and Time" format) are used to manage the dates found between 01/01/0001 at 00:00 and 12/31/9999 at 23:59.
Related Examples:
Calculations on durations Unit examples (WINDEV): Calculations on durations
[ + ] Calculations on dates and times with the WLanguage functions:
- Calculate the duration between two moments (dates and times)
- Calculate a sum of durations
- Calculate an average of durations
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/06/2024

Send a report | Local help