|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Date and Time Calculation > DTO. - Date Time Operations > Date & Time Calculations |
MiniRobotLanguage (MRL)
DTO.IsDateFuture Command
Check if a Date is in the Future
Intention
The DTO.IsDateFuture command is a simple conditional check that compares a specified date against the current system date. It returns `1` (true) if the specified date is strictly after the current date, and `0` (false) otherwise.
This is essential for validating user input, such as ensuring an appointment is set for a future date or checking if a license key has not yet become active. The command only considers the date part, ignoring the time of day.
Syntax
DTO.IsDateFuture|date|[format]|[$$RES]
Parameter Explanation
date - The date string to evaluate. Can be a variable or a literal string.
format - (Optional) The format of the `date` string. If omitted, "DD.MM.YYYY" is used.
$$RES - (Optional) The variable where the boolean result (`1` or `0`) is stored.
Example
'**********************************************
' DTO.IsDateFuture - Sample
'**********************************************
'
' Calculate tomorrow's date
DTO.AddToCurrentDate|1||$$DAA
' Check if tomorrow is in the future. $$RES will be 1.
DTO.IsDateFuture|$$DAA||$$RES
IFV.$$RES|= |1
MBX.Check 1: $$DAA is in the future.
EIF.
'
' Check if today's date is in the future. $$RES will be 0.
DTO.GetCurrentDate|0|$$DAB
DTO.IsDateFuture|$$DAB||$$RES
IFV.$$RES|= |0
MBX.Check 2: Today ($$DAB) is not considered the future.
EIF.
ENR.
Remarks
A date is considered "future" if it is at least one day after the current system date. The current date itself is not considered future.
Limitations:
The result is dependent on the accuracy of the computer's system clock.
See also:
• DTC. - Date and Time Calculation