---
url: >-
  /statelake/scripting-reference/functions-and-procedures/datetime-functions/startofthemonth.md
---

# StartOfTheMonth

The **StartOfTheMonth** function returns the date value that represents the first day in the month that has been specified by the given date parameter **AValue**.

The function will always replace the day number with one (01).

**Declaration**: Function StartOfTheMonth(const AValue: TDateTime): TDateTime

An example follows.

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