summaryrefslogtreecommitdiff
path: root/boost/date_time/time_facet.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/date_time/time_facet.hpp')
-rw-r--r--boost/date_time/time_facet.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/boost/date_time/time_facet.hpp b/boost/date_time/time_facet.hpp
index 38b2ba7639..1e07093ffc 100644
--- a/boost/date_time/time_facet.hpp
+++ b/boost/date_time/time_facet.hpp
@@ -866,6 +866,7 @@ namespace date_time {
break;
// %s is the same as %S%f so we drop through into %f
}
+ /* Falls through. */
case 'f':
{
// check for decimal, check special_values if missing
@@ -1088,9 +1089,12 @@ namespace date_time {
break;
}
case 'd':
+ case 'e':
{
try {
- t_day = this->m_parser.parse_day_of_month(sitr, stream_end);
+ t_day = (*itr == 'd') ?
+ this->m_parser.parse_day_of_month(sitr, stream_end) :
+ this->m_parser.parse_var_day_of_month(sitr, stream_end);
}
catch(std::out_of_range&) { // base class for exception bad_day_of_month
match_results mr;
@@ -1136,6 +1140,7 @@ namespace date_time {
// %s is the same as %S%f so we drop through into %f if we are
// not at the end of the stream
}
+ /* Falls through. */
case 'f':
{
// check for decimal, check SV if missing
@@ -1227,7 +1232,7 @@ namespace date_time {
date_type d(not_a_date_time);
if (day_of_year > 0) {
- d = date_type(static_cast<unsigned short>(t_year-1),12,31) + date_duration_type(day_of_year);
+ d = date_type(static_cast<unsigned short>(t_year),1,1) + date_duration_type(day_of_year-1);
}
else {
d = date_type(t_year, t_month, t_day);
@@ -1250,7 +1255,7 @@ namespace date_time {
if((c == '-' || c == '+') && (*sitr != c)) { // was the first character consumed?
mr.cache += c;
}
- this->m_sv_parser.match(sitr, stream_end, mr);
+ (void)this->m_sv_parser.match(sitr, stream_end, mr);
if(mr.current_match == match_results::PARSE_ERROR) {
std::string tmp = convert_string_type<char_type, char>(mr.cache);
boost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + tmp + "'"));