Ticket #3477: date_time.patch

File date_time.patch, 1.2 KB (added by me@…, 13 years ago)
  • boost/date_time/gregorian/conversion.hpp

     
    4141        boost::throw_exception(std::out_of_range(s));
    4242    }
    4343
    44     std::tm datetm = {}; // zero initialization is needed for extension members, like tm_zone
     44    std::tm datetm = {0,0,0,0,0,0,0,0,0,0,0}; // zero initialization is needed for extension members, like tm_zone
    4545    boost::gregorian::date::ymd_type ymd = d.year_month_day();
    4646    datetm.tm_year = ymd.year - 1900;
    4747    datetm.tm_mon = ymd.month - 1;
  • boost/date_time/posix_time/conversion.hpp

     
    4242  //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components
    4343  inline
    4444  std::tm to_tm(const boost::posix_time::time_duration& td) {
    45     std::tm timetm = {};
     45    std::tm timetm = {0,0,0,0,0,0,0,0,0,0,0};
    4646    timetm.tm_hour = date_time::absolute_value(td.hours());
    4747    timetm.tm_min = date_time::absolute_value(td.minutes());
    4848    timetm.tm_sec = date_time::absolute_value(td.seconds());