Change History Changes from Boost 1.32 to 1.33 (date_time 1.03 to 1.04) Type Description Bug Fix Previously, output streaming of partial_date would display the day as either a single or double digit integer (ie '1', or '12'). This has been corrected to always display a double digit integer (ie '01'). Feature Major new features related to management of local times. This includes the introduction of a series of new classes to represent time zones and local times (see Date Time Local Time for complete details). Feature Input and output facets have been re-written to support format-based redefinition of formats (see Date Time IO for complete details). Feature Functions have been added to facilitate conversions between tm structs for date, ptime, time_duration, and local_date_time. Functions for converting FILETIME, and time_t to ptime are also provided. See the individual sections for details. Feature A universal_time function has been added to the microsec_time_clock (full details of this function can be found here). Feature Functions have been added to facilitate conversions between tm structs for date, ptime, time_duration, and local_date_time. Functions for converting FILETIME, and time_t to ptime are also provided. See the individual sections for details. Feature A universal_time function has been added to the microsec_time_clock (full details of this function can be found here). Feature Date-time now uses reentrant POSIX functions on those platforms that support them when BOOST_HAS_THREADS is defined. Bug Fix Fixed a bug in serialization code where special values (not-a-date-time, infinities, etc) for ptime, time_duration would not read back correctly from an archive. The output serialization code wrote subfields such as time_duration.seconds() which are invalid for special values and thus undefined values. Thus when read back the values could cause strange behavior including execeptions on construction. Bug Fix Fixed multiple warnings generated with various platforms/compilers. Bug Fix Construction of a ptime with a time_duration beyond the range of 00:00 to 23:59:59.9... now adjusts the date and time to make the time_duration fall within this range (ie ptime(date(2005,2,1), hours(-5)) -> "2005-Jan-31 19:00:00" & ptime(date(2005,2,1), hours(35)) -> "2005-Feb-02 11:00:00"). Bug Fix Time parsing now correctly handles excessive digits for fractional seconds. Leading zeros are dropped ("000100" -> 100 frac_sec), and excessive digits are truncated at the proper place ("123456789876" -> 123456 or 123456789 depending on what precision the library was compiled with). Bug Fix Changes to the boost::serialization interface broke serialization compatibility for date_time. The user must provide a function to insure date_time objects are const before they are serialized. The function should be similar to: template<class archive_type, class temporal_type> void save_to(archive_type& ar, const temporal_type& tt) { ar << tt; } Bug Fix Use of the depricated boost::tokenizer interface has been updated to the current interface. This fixes compiler errors on some older compilers. Bug Fix Templatized formatters in the legacy IO system to accept char type. Also removed calls to boost::lexical_cast. Changes from Boost 1.31 to 1.32 (date_time 1.02 to 1.03) Type Description Bug Fix Snap to end of month behavior corrected for year_functor. Previously, starting from 2000-Feb-28 (leap year and not end of month) and iterating through the next leap year would result in 2004-Feb-29 instead of 2004-Feb-28. This behavior has been corrected to produce the correct result of 2004-Feb-28. Thanks to Bart Garst for this change. Feature Free function for creating a ptime object from a FILETIME struct. This function is only available on platforms that define BOOST_HAS_FTIME. Feature Microsecond time clock is now available on most windows compilers as well as Unix. Feature Use of the boost::serialization library is now available with most of the date_time classes. Classes capable of serialization are: date_generator classes, date, days, date_period, greg_month, greg_weekday, greg_day, ptime, time_duration, and time_period. Thanks to Bart Garst for this change. Feature Functions added to convert date and time classes to wstring. The library now provides to_*_wstring as well as to_*_string functions for: simple, iso, iso_extended, and sql for dates and compilers that support wstrings. Thanks to Bart Garst for this change. Feature Period classes now handle zero length and NULL periods correctly. A NULL period is a period with a negative length. Thanks to Frank Wolf and Bart Garst for this change. Feature Added end_of_month function to gregorian::date to return the last day of the current month represented by the date. Result is undefined for not_a_date_time or infinities. Bug Fix Removed incorrect usage of BOOST_NO_CWCHAR macro throughout library. Feature New names added for some date classes. Original names are still valid but may some day be deprecated. Changes are: date_duration is now days nth_kday_of_month is now nth_day_of_the_week_in_month first_kday_of_month is now first_day_of_the_week_in_month last_kday_of_month is now last_day_of_the_week_in_month first_kday_after is now first_day_of_the_week_after first_kday_before is now first_day_of_the_week_before Feature Free functions for date generators added. Functions are: days_until_weekday, days_before_weekday, next_weekday, and previous_weekday. days days_until_weekday(date, greg_weekday); days days_before_weekday(date, greg_weekday); date next_weekday(date, greg_weekday); date previous_weekday(date, greg_weekday); Thanks to Bart Garst for this change. Feature New experimental duration types added for months, years, and weeks. These classes also provide mathematical operators for use with date and time classes. Be aware that adding of months or years a time or date past the 28th of a month may show non-normal mathematical properties. This is a result of 'end-of-month' snapping used in the calculation. The last example below illustrates the issue. months m(12); years y(1); m == y; // true days d(7); weeks w(1); d == w; // true ptime t(...); t += months(3); date d(2004,Jan,30); d += months(1); //2004-Feb-29 d -= months(1); //2004-Jan-29 Input streaming is not yet implemented for these types. Thanks to Bart Garst for this change. Feature Unifying base class for date_generators brought in to gregorian namespace. See Print Holidays Example. Feature Added constructors for date and ptime that allow for default construction (both) and special values construction (ptime, both now support this). Default constructors initialize the objects to not_a_date_time (NADT). ptime p_nadt(not_a_date_time); ptime p_posinf(pos_infin); ptime p; // p == NADT date d; // d == NADT Thanks to Bart Garst for this change. Feature Output streaming now supports wide stream output on compiler / standard library combinations that support wide streams. This allows code like: std::wstringstream wss; date d(2003,Aug,21); wss << d; Thanks to Bart Garst for this change. Feature Input streaming for date and time types is now supported on both wide and narrow streams: date d(not_a_date_time); std::stringstream ss("2000-FEB-29"); ss >> d; //Feb 29th, 2000 std::wstringstream ws("2000-FEB-29"); ws >> d; //Feb 29th, 2000 Thanks to Bart Garst for this change. Bug Fix Fixed bug in duration_from_string() where a string formatted with less than full amount of fractional digits created an incorrect time_duration. With microsecond resolution for time durations the string "1:01:01.010" created a time duration of 01:01:01.000010 instead of 01:01:01.010000 Bug Fix Fixed the special value constructor for gregorian::date and posix_time::ptime when constructing with min_date_time or max_date_time. The wrong value was constructed for these. Changes from Boost 1.30 to 1.31 (date_time 1.01 to 1.02) Type Description Bug Fix Build configuration updated so dll, statically, and dynamically linkable library files are now produced with MSVC compilers. See Build/Compiler Information for more details. Bug Fix Time_duration from_string is now correctly constructed from a negative value. (ie "-0:39:00.000") Code provided by Bart Garst. Bug Fix Fixed many MSVC compiler warnings when compiled with warning level 4. Feature Added prefix decrement operator (--) for date and time iterators. See Time Iterators and Date Iterators for more details. Code provided by Bart Garst. Feature Special_values functionality added for date_duration, time_duration and time classes. Code provided by Bart Garst. Bug Fix Fixed time_duration_traits calculation bug which was causing time duration to be limited to 32bit range even when 64 bits were available. Thanks to Joe de Guzman for tracking this down. Bug Fix Provided additional operators for duration types (eg: date_duration, time_duration). This includes dividable by integer and fixes to allow +=, -= operators. Thanks to Bart Garst for writing this code. Also, the documentation of Calculations has been improved. Bug Fix Added typedefs to boost::gregorian gregorian_types.hpp various date_generator function classes. Feature Added from_time_t function to convert time_t to a ptime. Feature Added a span function for combining periods. See date period and time period docs. Feature Added a function to time_duration to get the total number of seconds in a duration truncating any fractional seconds. In addition, other resolutions were added to allow for easy conversions. For example seconds(1).total_milliseconds() == 1000 seconds(1).total_microseconds() == 1000000 hours(1).total_milliseconds() == 3600*1000 //3600 sec/hour seconds(1).total_nanoseconds() == 1000000000 Feature Added output streaming operators for the date generator classes - partial_date, first_kday_after, first_kday_before, etc. Thanks to Bart Garst for this work. Feature Added unary- operators for durations for reversing the sign of a time duration. For example: time_duration td(5,0,0); //5 hours td = -td; //-5 hours Thanks to Bart Garst for this work. Feature Added support for parsing strings with 'month names'. Thus creating a date object from string now accepts multiple formats ("2003-10-31","2003-Oct-31", and "2003-October-31"). Thus, date d = from_simple_string("2003-Feb-27") is now allowed. A bad month name string ( from_simple_string("2003-SomeBogusMonthName-27")) will cause a bad_month exception. On most compilers the string compare is case insensitive. Thanks to Bart Garst for this work. Feature In addition to support for month names or numbers, functions have been added to create date objects from multi-ordered date strings. Ex: "January-21-2002", "2002-Jan-21", and "21-Jan-2003". See Date Class for more details. Bug-Fix Various documentation fixes. Thanks to Bart Garst for updates. Changes from Boost 1.29 to 1.30 (date_time 1.00 to 1.01) Notice: The interface to the partial_date class (see date_algorithms) was changed. The order of construction parameters was changed which will cause some code to fail execution. This change was made to facilitate more generic local time adjustment code. Thus instead of specifying partial_date pd(Dec,25) the code needs to be changed to partial_date pd(25, Dec); Type Description Bug Fix Added new experimental feature for Daylight Savings Time calculations. This allows traits based specification of dst rules. Feature Added new interfaces to calculate julian day and modified julian day to the gregorian date class. See boost::gregorian::date. Feature Add new interface to calculate iso 8601 week number for a date. See boost::gregorian::date. Feature Add an iso 8601 time date-time format (eg: YYYYMMDDTHHHMMSS) parsing function. See Class ptime for more information. Feature Added a length function to the period template so that both date_periods and time_periods will now support this function. Bug Fix Split Jamfiles so that libs/date_time/build/Jamfile only builds library and /libs/date_time/libs/test/Jamfile which runs tests. Bug Fix Fixed many minor documentation issues. Bug Fix Removed the DATE_TIME_INLINE macro which was causing link errors. This macro is no longer needed in projects using the library. Bug Fix Added missing typedef for year_iterator to gregorian_types.hpp Bug Fix Fixed problem with gregorian ostream operators that prevented the use of wide streams. Bug-Fix Tighten error handling for dates so that date(2002, 2, 29) will throw a bad_day_of_month exception. Previously the date would be incorrectly constructed. Reported by sourceforge bug: 628054 among others.