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

# DaysInMonth

## Declaration

`function DaysInMonth(const AValue: TDateTime): Word;`

### Example

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

## Description

Returns the number of days in the month specified by the given date.
