PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Checks the validity of a date found between January 01 0001 and December 31 9999.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the 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
WEBDEV - Browser code This function is now available in browser code.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
WEBDEV - Browser code This function is now available in browser code.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WEBDEV - Browser code This function is now available in browser code.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
Res = DateValid("20011225")  // Res returns True
Res = DateValid("20012512")  // Res returns False
Res = DateValid("2001")      // Res returns False
Res = DateValid("14821225")  // Res returns True
Syntax
<Result> = DateValid(<Date>)
<Result>: Boolean
  • True if the date is valid,
  • False otherwise. A date is considered as being invalid if:
    • The "MM" part of the date is not included between "01" and "12".
    • The "DD" part of the date is not included between "01" and "30", between "01" and "31", between "01" and "28" or between "01" and "29" (according to the specified month).
    • The string passed in parameter does not contain 8 characters.
    • This date is included between October 5, 1582 (inclusive) and October 14, 1582 (inclusive). Indeed, the calendar changed in the night from October 4th 1582 to October 15th 1582 (Adjustment to the Gregorian calendar: see the notes).
<Date>: Character string or Date variable
Character string in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
Remarks
  • If the date is before October 4th 1582, this date is part of the Julian calendar. This date is valid.
  • If the date is after October 15th 1582, this date is part of the Gregorian calendar. This date is valid.
  • A year is a leap year if it can be divided by 4, except if the year is also a multiple of 100. The exception concerns the years multiple of 400 that are leap years. For the other years, DateValid returns False for February 29.
    Tip: To enter a date in correct format, use a Date edit control. In this case, the validity of the date is automatically checked.
  • 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.
Related Examples:
Management of dates Unit examples (WINDEV): Management of dates
[ + ] Using the Date type of WLanguage and the functions for handling dates.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment