Reputation: 183
if StrToInt(sY) > 2013 then
begin
bDate := False;
ShowMessage('Year is bigger than current year');
Exit;
end;
This is what I have at this stage but I'm pretty sure there is a way to get the current year instead of having to manually type it in delphi code, would be much appreciated if someone could help me with the code for it.
Upvotes: 10
Views: 50225
Reputation: 34939
DateUtils.YearOf(Now)
will get you the current year,
or use
As @Remy points out, Date
is more to the point than Now
. So is DateUtils.Today
.
Upvotes: 34