QV – Count days in a year in script

In the script I need a counter to give the same day (in different years) a number, and when a new year begin it will start from 1 again. So when I reload my script I want a table that look like this:

Date            Number
01/01/2015      1
......          ...
10/30/2015      303
10/31/2015      304
11/01/2015      305
....            ...
12/31/2015      365
01/01/2016      1
01/02/2016      2
....            ....

How can I do this?

QV – Count days in a year in script