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

# StartOfTheMonth

## Declaration

`Function StartOfTheMonth(const AValue: TDateTime): TDateTime`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value :=StartOfTheMonth(Date); // if Date is 2009-06-25 then result is 2009-06-01
end;
```

## Description

Returns the date value that represents the first day in the month specified by the given date (AValue).
