: hi, : : i need to validate dates so that my START date cannot be in the past : and my END date cannot be before the start date. : : i am using Datepickers for both dates. i know i have to use the 'NOW' function but i'm not entirely sure how it works. : : thanks : The TDateTime type is actually a floating-point number, which lists the number of days since a certain date. This means that the END date cannot have less days than the START date. In code: [code] if double(EndDate) < double(StartDate) then ShowMessage('End cannot come before begin'); [/code]
Comments
:
: i need to validate dates so that my START date cannot be in the past
: and my END date cannot be before the start date.
:
: i am using Datepickers for both dates. i know i have to use the 'NOW' function but i'm not entirely sure how it works.
:
: thanks
:
The TDateTime type is actually a floating-point number, which lists the number of days since a certain date. This means that the END date cannot have less days than the START date. In code:
[code]
if double(EndDate) < double(StartDate) then
ShowMessage('End cannot come before begin');
[/code]