diff --git a/include/boost/date_time/gregorian/greg_date.hpp b/include/boost/date_time/gregorian/greg_date.hpp index e23609f..f0ed7fc 100644 --- a/include/boost/date_time/gregorian/greg_date.hpp +++ b/include/boost/date_time/gregorian/greg_date.hpp @@ -74,7 +74,8 @@ namespace gregorian { day_of_year_type day_of_year() const { date start_of_year(year(), 1, 1); - return ((*this-start_of_year).days() + 1); + unsigned short doy = static_cast((*this-start_of_year).days() + 1); + return day_of_year_type(doy); } //!Return the Modified Julian Day number for the date. long modjulian_day() const