PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
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
Transforms a date into an integer. This integer corresponds to:
  • the number of days between January 1st 1800 and the specified date.
  • the number of days between January 1st of the specified date and the specified date.
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 18 and later
WINDEVUniversal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
WINDEVUniversal Windows 10 App This function is now available in Windows Store apps mode.
WINDEVUniversal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
WINDEVUniversal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
WINDEVUniversal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVUniversal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Number of days passed between 01/01/1800 and 25/12/2001
DateToInteger("20011225")   // Returns 73773
 
// Number of days passed between 01/01/1800 and 03/01/1800
DateToInteger("18000103")   // Returns 3
WINDEVUniversal Windows 10 AppJavaUser code (UMC)Stored procedures
// Number of days passed between 01/01/2004 and 25/01/2004
DateToInteger("20040125", True) // Returns 25
Syntax
<Result> = DateToInteger(<Date> [, <From beginning of year>])
<Result>: Integer
Number identifying the date.
<Date>: Character string, Date or DateTime variable
Date to convert. This date can correspond to:
  • a character string in YYYYMMDD format (YYYY corresponds to the year, MM to the month and DD to the day).
  • Versions 24 and later
    a character string in YYYYMMDDHHMMSSCC format (YYYY corresponds to year, MM to month, DD to day, HH to hour, MM to minutes, SS to seconds and CC to hundredths of a second (use CCC for milliseconds). In this case, only the date is taken into account.
    New in version 24
    a character string in YYYYMMDDHHMMSSCC format (YYYY corresponds to year, MM to month, DD to day, HH to hour, MM to minutes, SS to seconds and CC to hundredths of a second (use CCC for milliseconds). In this case, only the date is taken into account.
    a character string in YYYYMMDDHHMMSSCC format (YYYY corresponds to year, MM to month, DD to day, HH to hour, MM to minutes, SS to seconds and CC to hundredths of a second (use CCC for milliseconds). In this case, only the date is taken into account.
  • a Date variable.
  • Versions 24 and later
    a DateTime variable. In this case, only the date is taken into account.
    New in version 24
    a DateTime variable. In this case, only the date is taken into account.
    a DateTime variable. In this case, only the date is taken into account.
<From beginning of year>: Optional boolean
  • True to get the number of days passed between January 1st of the specified date and the specified date,
  • False (default value) to get the number of days passed between January 1st 1800 and the specified date.
Remarks
  • The validity of the date passed in parameter is checked. An error message is displayed if the date is invalid. The validity of a date can be checked by DateValid.
  • DateToInteger can be used to calculate the number of days passed between two dates. You also have the ability to use DateDifference.
  • 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:
WD Evaluation period Training (WINDEV): WD Evaluation period
[ + ] This example explains how to limit the use of an application to a given period (evaluation period).
The following topics are presented in this example:
1/ the protection of an application for a given duration
2/ the management of the registry

Summary of the example supplied with WINDEV:
When this example is started for the first time, it is activated for an evaluation period set to 5 days.
The information regarding the date when it was first started is stored in the registry and a control key is used to check whether this date was not modified by the end user. At the end of the evaluation period, the application is locked, unless the end user provides the code for unlocking the application
Component : wd250std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
WD24 - DateToInteger
DateToInteger explicitely asks for an 8 character string YYYYMMDD and NOT for the 18-character string YYYYMMDDHHMMSSCC-string as shown.
Guenter
25 Jul. 2019