# Get day of the year

**URL:** https://www.finalbuilder.com/forums/t/get-day-of-the-year/1996
**Category:** Discussion
**Created:** [June 6, 2012, 11:12am UTC](https://www.finalbuilder.com/forums/t/get-day-of-the-year/1996 "2012-06-06T11:12:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vjek](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/v/f05b48/32.png) [@vjek](https://www.finalbuilder.com/forums/u/vjek)
#### Post date: [June 6, 2012, 11:12am UTC](https://www.finalbuilder.com/forums/t/get-day-of-the-year/1996/1 "2012-06-06T11:12:18Z")

</div>

Hi,

I am trying to find out a way to get the current day of the year.. Like '155'th day of the year etc.

Using getDateTime action, I know we can get the current date in terms of month and date. But just wondering is there a way I can get the current day of the year?

Thanks

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [June 7, 2012, 6:55am UTC](https://www.finalbuilder.com/forums/t/get-day-of-the-year/1996/2 "2012-06-07T06:55:32Z")

</div>

add a project variable to hold the value, Use the runscript action (javascript) :   
 [code]var d = new Date();var y = d.getFullYear();var onejan = new Date(y,0,1);FBVariables.DAYOFYEAR = Math.ceil((d - onejan) / 86400000); [/code]
