PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
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.
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for Windows Phone applications.
Universal Windows 10 App This function is now available for Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 26 and later
Apple Watch This function is now available for Apple Watch applications.
New in version 26
Apple Watch This function is now available for Apple Watch applications.
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