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

# DaysInYear

## Declaration

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

### Example

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

## Description

Returns the number of days in the year specified by the given date. This can be used to determine whether it is a leap year or not.
