ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Date and time management functions
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
DateDifference (Function)
In french: DateDifference
Calculates the number of days between two dates.
New in version 26
Apple Watch This function is now available for Apple Watch applications.
Example
// Calculates the number of days elapsed since 01/01/1998
nbDays is int
nbDays = DateDifference("19980101", Today())
// Displays the result
Info(nbDays + " days elapsed")
Syntax
<Result> = DateDifference(<Start date> , <End date>)
<Result>: Integer
Number of days elapsed between two dates. This number of days is the result of the following operation:
<End date> - <Start date>

The number of days is negative if <Start date> is after <End date>.
<Start date>: Character string or Date variable
Start date for the calculation in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
<End date>: Character string or Date variable
End date for the calculation in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
Remarks
The validity of the dates passed as parameters is checked. A message is displayed if the date is invalid. You can check the validity of a date using DateValid.
This function cannot be used to calculate the difference between two dates before October 14, 1582 (the change from the Julian to the Gregorian calendar will not be taken into account).
The date 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.
Related Examples:
Management of dates Unit examples (WINDEV): Management of dates
[ + ] Using the Date type of WLanguage and the functions for handling dates.
Business / UI classification: Neutral code
Component: wd260std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video DateDiference
https://youtu.be/1cnd0XoKAdg

https://windevdesenvolvimento.blogspot.com/2019/01/dicas-1986-windev-data-25.html

amarildo
15 Jan. 2019

Last update: 10/16/2020

Send a report | Local help