PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Declaration and initialization
  • Properties available for the dates
  • Range of dates
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 Date type is used to easily handle the dates. This type is used to manage the conversions almost automatically (StringToDate, DateToString, IntegerToDate, DateToInteger, ...).
This type can be used:
  • to retrieve and handle the HFSQL items in Date format.
  • to retrieve and handle the Date edit controls.
  • in the WLanguage functions used to manage the dates.
  • to perform calculations on dates (difference, addition, ...). See Operations that can be performed on the Date type for more details.
Notes:
  • Several properties can be used with the Date type, to retrieve part of the date for example.
  • See Declaring a variable for more details on the declaration of this type of variable and the use of WLanguage properties.
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
StartDate is Date = 1205
EndDate is Date = "20011231"     // 31/12/2001
TodaysDate is Date = DateSys()
Remarks

Declaration and initialization

A Date variable can be initialized with a value whose type is:
  • Date
  • DateTime: only the date will be taken into account.
  • Character string, in YYYYMMDD format (YYYY: year, MM: Month, DD: Day)
  • Integer: the date will correspond to the number of days passed between January 1st 1800 and the specified date.
By default, a Date variable is initialized with today's date (system date). 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 Date variable with the system date by using Now.
New in version 19
Note: You also have the ability to initialize a Date variable with the system date by using Now.
Note: You also have the ability to initialize a Date variable with the system date by using Now.

Properties available for the dates

The following properties can be used on the dates:
YearReturns or modifies the year of the specified date (in integer format).
DayReturns or modifies the day of the specified date (in integer format).
MonthReturns or modifies the month of the specified date (in integer format).
See Operations that can be performed on the Date type for more details.
StartDate is Date = "20011201"
// Adds 5 years to the date
StartDate..Year += 5
// Modifies the month
StartDate..Month = 5
// Calculates the end (30 days later)
EndDate = StartDate
EndDate..Month++
EndDate..Day--

Range of dates

The Date type allows you to manage the dates included between 01/01/0001 and 12/31/9999.
Note: The calculations performed on dates by the WLanguage functions or by the WLanguage properties are accurate from January 1st 1583.
Related Examples:
Management of dates Unit examples (WINDEV): Management of dates
[ + ] Using the Date type of WLanguage and the functions for handling dates.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment