ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Time and date management properties
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 Date property is used to:
  • Retrieve the date from a DateTime variable.
  • Modify the date in a DateTime variable.
  • Retrieve the date from a Date item (in "Date and Time" format).
  • Modify the date in a Date item (in "Date and Time" format).
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"
EndDate is Date = "20011209"
// Change the date
StartDate.Date = "20011225"
// Modify the Date part
StartDate.Date = EndDate
// Operations performed on a DateTime item
MyWork.StartDate = "200112121515"
MyWork.EndDate = "20011209"
// Change the date
MyWork.StartDate.Date = "20011225"
// Modify the Date part
MyWork.StartDate.Date = MyWork.EndDate
Syntax

Finding out the date in a DateTime variable Hide the details

<Result> = <DateTime>.Date
<Result>: Date
Date extracted from the DateTime variable.
<DateTime>: DateTime
Name of the DateTime variable to be used.

Modifying the date in a DateTime variable Hide the details

<DateTime>.Date = <New date>
<DateTime>: Date or DateTime
Name of the DateTime variable to be used.
<New date>: Character string or date or integer
New date in the following format:
  • YYYYMMDD
  • Integer: number of days passed between January 1st 1800 and the specified date.
Replaces the date in the specified variable.

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

<Result> = <Data file>.<Item>.Date
<Result>: Date
Date extracted from the item.
<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.

Modifying the date in a Date variable (Date and Time format) Hide the details

<Data file>.<item>.Date = <New date>
<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 date>: Character string or date or integer
New date in the following format:
  • YYYYMMDD
  • Integer: number of days passed between January 1st 1800 and the specified date.
Replaces the date in the specified date.
Remarks
The Date and DateTime types are used to handle dates from 01/01/0001 to 12/31/9999.
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