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

# EndOfTheMonth

## Declaration

`function EndOfTheMonth(const AValue: TDateTime): TDateTime;`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := EndOfTheMonth(Date); //if date is 2009-06-25 then result is 2009-06-30 23:59:59.999
end;
```

## Description

Returns a DateTime that is the last possible millisecond of a month.
