diff --git a/include/date/date.h b/include/date/date.h index 73e95dc..7519bb8 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -2889,10 +2889,11 @@ operator<<(std::basic_ostream& os, const year_month_day& ymd) os.fill('0'); os.flags(std::ios::dec | std::ios::right); os.imbue(std::locale::classic()); - os << ymd.year() << '-'; + os << static_cast(ymd.year()) << '-'; os.width(2); os << static_cast(ymd.month()) << '-'; - os << ymd.day(); + os.width(2); + os << static_cast(ymd.day()); if (!ymd.ok()) os << " is not a valid date"; return os;