Ticket #3477: date_time.patch
File date_time.patch, 1.2 KB (added by , 13 years ago) |
---|
-
boost/date_time/gregorian/conversion.hpp
41 41 boost::throw_exception(std::out_of_range(s)); 42 42 } 43 43 44 std::tm datetm = { }; // zero initialization is needed for extension members, like tm_zone44 std::tm datetm = {0,0,0,0,0,0,0,0,0,0,0}; // zero initialization is needed for extension members, like tm_zone 45 45 boost::gregorian::date::ymd_type ymd = d.year_month_day(); 46 46 datetm.tm_year = ymd.year - 1900; 47 47 datetm.tm_mon = ymd.month - 1; -
boost/date_time/posix_time/conversion.hpp
42 42 //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components 43 43 inline 44 44 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}; 46 46 timetm.tm_hour = date_time::absolute_value(td.hours()); 47 47 timetm.tm_min = date_time::absolute_value(td.minutes()); 48 48 timetm.tm_sec = date_time::absolute_value(td.seconds());