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

# YearOf

## Declaration

`function YearOf( const AValue : TDateTime) : Word`

### Example

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

## Description

Returns the number of the year represented by the given date value.
