PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Operators available for the years
  • Leap years
  • Calculations on 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
..Year is used to:
Note: ..Year is used to simplify the operations performed on the dates: adding a year, etc.
Reminder: The Date items and variables are used to manage:
  • the simple dates "Year - Month - Day" (YYYYMMDD format).
  • the dates and times "Year - Month - Day - Hours - Minutes - Seconds - Milliseconds" (YYYYMMDDHHMMSSLLL format).
  • the durations "Number of days - Number of hours - Number of minutes - Number of seconds - Number of milliseconds" (+DHHMMSSLLL format).
Versions 16 and later
Universal Windows 10 App This property is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This property is now available for the Windows Phone applications.
Universal Windows 10 App This property is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This property is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This property is now available for the iPhone/iPad applications.
iPhone/iPad This property is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This property is now available in Windows Store Apps mode.
New in version 18
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Versions 20 and later
WEBDEV - Browser code This property is now available in browser code for the Date or DateTime variables.
New in version 20
WEBDEV - Browser code This property is now available in browser code for the Date or DateTime variables.
WEBDEV - Browser code This property is now available in browser code for the Date or DateTime variables.
Versions 21 and later
Apple Watch This property is now available in Apple Watch mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This property is now available in Apple Watch mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Apple Watch This property is now available in Apple Watch mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Example
StartDate is Date = DateSys()
// Add 1 year to the date
StartDate..Year++
// Modify the years
StartDate..Year = 2003
Syntax

Finding out the year of a Date or DateTime variable or item Hide the details

<Result> = <Date>..Year
<Result>: Integer
Year on 4 digits.
<Date>: Date or DateTime
Name of the Date or DateTime variable or item to use.
WEBDEV - Browser code Only the browser Date or DateTime variables can be used.

Modifying the year of a Date or DateTime variable or item Hide the details

<Date>..Year = <New Year>
<Date>: Date or DateTime
Name of the Date or DateTime variable or item to use.
WEBDEV - Browser code Only the browser Date or DateTime variables can be used.
<New Year>: Integer or character string
New year in digits (between 1 and 9999). Replaces the year in the specified date.
Remarks

Operators available for the years

The following arithmetic operators can be used with ..Year:
  • ++ and --
  • += and -=
StartDate is Date = "20011212"
StartDate..Year++  // Add 1 year to the date
StartDate..Year+=5 // Add 5 years to the date
StartDate..Year-=5 // Subtract 5 years to the date

Leap years

If the date handles corresponds to February 29 of a leap year, adding or subtracting a year to the date also changes the day. For example:
StartDate is Date = "19960229"
// Add 1 year to the date
StartDate..Year++
// StartDate is "19970228"

Calculations on dates

The storage format allows you to store dates from 01/01/0001 to 12/31/9999.
The calculations performed on dates by the WLanguage functions or by the WLanguage properties are accurate from January 1st 1583.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment