7.9. Finding the Day of the Year
The day number within the year is sometimes called the Julian date, which is not directly related to the Julian calendar, which has gone out of style. Other people insist that this usage is not correct, so we won't use it from here on.
No matter what you call it, there will be times you want to know what day of the year it is, from 1 to 366. This is easy in Ruby; we use the yday method:
t = Time.now day = t.yday # 315