ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Date and time functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Converts a date to an integer. This integer corresponds to:
  • the number of days elapsed between January 1, 1800 and a specified date.
  • the number of days elapsed between January 1 of a given date and another specified date.
WEBDEV - Browser code In this version, you can only get the number of days elapsed between January 1, 1800 and the specified date.
Example
MyDate is Date
// Number of days elapsed between 01/01/1800 and 12/25/2001
MyDate = "20011225"
MyDate.ToInteger()   // Returns 73773
 
// Number of days elapsed between 01/01/1800 and 01/03/1800
MyDate = "18000103"
MyDate.ToInteger()   // Returns 3
WEBDEV - Server codePHPAjaxStored procedures
MyDate is Date
// Number of days elapsed between 01/01/2004 and 01/25/2004
MyDate = "20040125"
MyDate.ToInteger(True) // Returns 25
Syntax
<Result> = <Date>.ToInteger()
<Result>: Integer
Number of days elapsed between:
  • January 1 of a given date and another specified date.
  • January 1, 1800 and a given date
<Date>: Date or DateTime variable
Date to convert. This date can correspond to:
  • a Date variable.
  • a DateTime variable. In this case, only the date is taken into account.
Remarks
  • The validity of the date passed as parameter is checked. An error message is displayed if the date is invalid. You can check the validity of a date using DateValid.
  • <Date type>.ToInteger and DateDifference can be used to calculate the number of days elapsed between two dates.
  • The date storage format allows you to store dates from 01/01/0001 to 12/31/9999. WLanguage functions and WLanguage properties make accurate calculations on dates 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: wd290std.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help