|
|
|
|
|
DateToInteger (Function) In french: DateVersEntier Converts a date to an integer. This integer corresponds to: - the number of days between January 1, 1800 and a specified date.
- the number of days elapsed between January 1 of a given date and another specified date.
DateToInteger("20011225")
DateToInteger("18000103")
Syntax
<Result> = DateToInteger(<Date> [, <From beginning of year>])
<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>: 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).
- a character string in YYYYMMDDHHmmSSCC format (YYYY corresponds to the year, MM to the month, DD to the day, HH to hours, mm to minutes, SS to seconds and CC to hundredths of a second (use CCC for thousandths of a second)). In this case, only the date is taken into account.
- a Date variable.
- 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 elapsed between January 1st of a given date and another specified date,
- False (default) to get the number of days elapsed between January 1st 1800 and the specified date.
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.
- DateToInteger 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:
|
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
|
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|