summaryrefslogtreecommitdiff
path: root/boost/date_time/gregorian/greg_facet.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/date_time/gregorian/greg_facet.hpp')
-rw-r--r--boost/date_time/gregorian/greg_facet.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/boost/date_time/gregorian/greg_facet.hpp b/boost/date_time/gregorian/greg_facet.hpp
index f720aac3bf..5352df1398 100644
--- a/boost/date_time/gregorian/greg_facet.hpp
+++ b/boost/date_time/gregorian/greg_facet.hpp
@@ -13,6 +13,7 @@
#include <boost/date_time/gregorian/gregorian_types.hpp>
#include <boost/date_time/date_formatting_locales.hpp> // sets BOOST_DATE_TIME_NO_LOCALE
#include <boost/date_time/gregorian/parsers.hpp>
+#include <boost/io/ios_state.hpp>
//This file is basically commented out if locales are not supported
#ifndef BOOST_DATE_TIME_NO_LOCALE
@@ -75,9 +76,9 @@ namespace gregorian {
greg_month_formatter::format_month(m, os, f);
}
- else { //default to numeric
- charT fill_char = '0';
- os << std::setw(2) << std::setfill(fill_char) << m.as_number();
+ else { // default to numeric
+ boost::io::basic_ios_fill_saver<charT> ifs(os);
+ os << std::setw(2) << std::setfill(os.widen('0')) << m.as_number();
}
return os;
@@ -142,7 +143,8 @@ namespace gregorian {
std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& os, const partial_date& pd)
{
- os << std::setw(2) << std::setfill('0') << pd.day() << ' '
+ boost::io::basic_ios_fill_saver<charT> ifs(os);
+ os << std::setw(2) << std::setfill(os.widen('0')) << pd.day() << ' '
<< pd.month().as_short_string() ;
return os;
}