---
title: "Start of year function"
canonical: "https://support.appfire.com/space/PSJ/811663603/Start%20of%20year%20function"
format: markdown
---
> Macro (aura-html)

> Macro (button-handy)



> Macro (excerpt)
> 
> Returns a date for the begining of the year like 2024-01-05 00:00:00.

```
function startOfYear() {
    int weeks = week(startOfMonth(currentDate())) - 1;
    interval weeksIntvl = trim(weeks) + "w";
    return startOfMonth(currentDate()) - weeksIntvl;
}
```