Computing day of year in C++

I have been recently asked on my post on the date library if the library has a function for computing the day of the year. It actually does not, although it is fairly simple to compute it. UPDATE: Howard Hinnant has shown in a comment below how to write a day_of_year() function using the date…