# Use calender year

**URL:** <https://community.silverfin.com/t/use-calender-year/1391>\
**Category:** Templates\
**Tags:** drops, drop\_period\
**Created:** [February 19, 2019, 12:57pm UTC](https://community.silverfin.com/t/use-calender-year/1391 "2019-02-19T12:57:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [February 19, 2019, 12:57pm UTC](https://community.silverfin.com/t/use-calender-year/1391/1 "2019-02-19T12:57:37Z")

</div>

Hi

Can a calender year be used in a calculation? I want to calculate the age of the director. I’ve taken financial year now, but that is not always correct.

> Blockquote  
> {% assign leeftijd = custom.director.geboortedatum | date:“%Y” %}  
> {{ period.financial\_year-leeftijd | integer }}

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [February 20, 2019, 9:09am UTC](https://community.silverfin.com/t/use-calender-year/1391/2 "2019-02-20T09:09:07Z")

</div>

> [@sylvia.debaeremaeker](#):
>
> Blockquote  
> {% assign leeftijd = custom.director.geboortedatum | date:“%Y” %}  
> {{ period.financial\_year-leeftijd | integer }}

Hi Sylvia

You could do the following:

> ```
> {% input custom.birth.day as:date %}
> 
> {% assign birthday_year = custom.birth.day | date:"%Y" %}
> {% assign today_year = "now" | date:"%Y" %}
> {% assign birthday_month = custom.birth.day | date:"%-m" %}
> {% assign today_month = "now" | date:"%-m" %}
> {% assign birthday_day = custom.birth.day | date:"%-d" %}
> {% assign today_day = "now" | date:"%-d" %}
> 
> {% assign diff = 0 %}
> {% if (today_month-birthday_month) > 0 %}
> {% assign diff = 1 %}
> {% elsif (today_month-birthday_month) == 0 and (today_day-birthday_day) >= 0 %}
> {% assign diff = 1 %}
> {% endif %}
> 
> {{ INT(today_year-birthday_year-diff) }}
> 
> ```

By using `now` as a keyword, the day of today is used. If you want to use the date of the current period instead, you can use `period.start_date` or `period.end_date` depending on which moment in the period you want to check.

Hope this helps.

Kind regards  
Sam

---

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [February 20, 2019, 9:44am UTC](https://community.silverfin.com/t/use-calender-year/1391/3 "2019-02-20T09:44:09Z")

</div>

Yes, this seems to work!  
Thx!

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [February 20, 2019, 10:05am UTC](https://community.silverfin.com/t/use-calender-year/1391/4 "2019-02-20T10:05:16Z")

</div>

You’re welcome! 🙂

---

<div class="post-metadata">

**Author:** ![SamVanEenoo](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/samvaneenoo/32/134_2.png) [@SamVanEenoo](https://community.silverfin.com/u/SamVanEenoo)\
**Post date:** [February 20, 2019, 10:05am UTC](https://community.silverfin.com/t/use-calender-year/1391/5 "2019-02-20T10:05:27Z")

</div>

Closed on February 20, 2019, 10:05am UTC


