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

# MinuteOfTheYear

A similar function to **HourOfTheYear**, the function **MinuteOfTheYear** returns the number of complete minutes between the **TDateTime** value entered as **AValue**, and 12:00 A.M. of the first day of the year that includes **AValue**.

It can be a large number.

**Declaration**: Function MinuteOfTheYear(const AValue: TDateTime): Cardinal;

A simple example follows.

```pascal
procedure ScriptEvent (var Value : variant);
var
  ThoseMinutes : cardinal;
begin
 //YESTERDAY is 28-11-2023, so the result is 476640
  ThoseMinutes := MinuteOfTheYear(Yesterday);
  LogInfo('The number of minutes since 1st Jan are '+IntToStr(ThoseMinutes));
end;
```
