---
url: /flow/guide/scripting-reference/functions/datetime/isvaliddate.md
---

# IsValidDate

## Declaration

`function IsValidDate(const AYear: Word; const AMonth: Word; const ADay: Word): Boolean;`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := IsValidDate(2009, 06, 25); //returns true if the given date parts would create a valid date
end;
```

## Description

Returns True if the given date parts would return a valid date. Useful for testing Date parts prior to passing them to the [EncodeDateTime](/flow/guide/scripting-reference/functions/datetime/encodedatetime) function.
