mirror of
https://github.com/boostorg/date_time.git
synced 2026-02-24 03:52:16 +00:00
282 lines
13 KiB
XML
282 lines
13 KiB
XML
<section id="date_time.changes">
|
|
<title>Change History</title>
|
|
|
|
<!-- if each new change tgroup has a "Bug Fix" as the first "Type", the columns will line up nicely -->
|
|
|
|
<bridgehead renderas="sect3">Changes from Boost 1.31 to 1.32 (date_time 1.02 to 1.03)</bridgehead>
|
|
<informaltable frame="all">
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Type</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>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.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Use of the boost::serialization library is now available with many 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.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>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.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>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.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Removed incorrect usage of BOOST_NO_CWCHAR macro throughout library.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>New names added for some date classes. Original names are still valid but may some day be deprecated. Changes are:
|
|
<simplelist type='horiz' columns='3'>
|
|
<member>date_duration</member>
|
|
<member>is now</member>
|
|
<member>days</member>
|
|
<member>nth_kday_of_month</member>
|
|
<member>is now</member>
|
|
<member>nth_day_of_the_week_in_month</member>
|
|
<member>first_kday_of_month</member>
|
|
<member>is now</member>
|
|
<member>first_day_of_the_week_in_month</member>
|
|
<member>last_kday_of_month</member>
|
|
<member>is now</member>
|
|
<member>last_day_of_the_week_in_month</member>
|
|
<member>first_kday_after</member>
|
|
<member>is now</member>
|
|
<member>first_day_of_the_week_after</member>
|
|
<member>first_kday_before</member>
|
|
<member>is now</member>
|
|
<member>first_day_of_the_week_before</member>
|
|
</simplelist>
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Free functions for date generators added. Functions are: days_until_weekday, days_before_weekday, next_weekday, and previous_weekday.
|
|
<programlisting>
|
|
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);</programlisting>
|
|
Thanks to Bart Garst for this change.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>New duration types added for months, years, and weeks. These classes also provide mathematical operators for use with date and time classes. Input streaming is not yet implemented for these types.
|
|
<programlisting>
|
|
months m(12);
|
|
years y(1);
|
|
m == y; // true
|
|
days d(7);
|
|
weeks w(1);
|
|
d == w; // true</programlisting>
|
|
Thanks to Bart Garst for this change.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Unifying base class for date_generators brought in to gregorian namespace. See <link linkend="date_time.examples.print_holidays">Print Holidays Example</link>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>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).
|
|
<programlisting>
|
|
ptime p_nadt(not_a_date_time), p_posinf(pos_infin);
|
|
ptime p; // p == NADT
|
|
date d; // d == NADT</programlisting>
|
|
Thanks to Bart Garst for this change.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Output streaming now supports wide stream output on compiler / standard library combinations that support wide streams. This allows code like:
|
|
<programlisting>
|
|
std::wstringstream wss;
|
|
date d(2003,Aug,21);
|
|
wss << d;</programlisting>
|
|
Thanks to Bart Garst for this change.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Input streaming for date and time types is now supported on both wide and narrow streams:
|
|
<programlisting>
|
|
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</programlisting>
|
|
Thanks to Bart Garst for this change.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Fixed the special value constructor for date when constructing date(min_date_time) or date(max_date_time) the wrong value was constructed for these.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
|
|
<bridgehead renderas="sect3">Changes from Boost 1.30 to 1.31 (date_time 1.01 to 1.02)</bridgehead>
|
|
<informaltable frame="all">
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Type</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Build configuration updated so dll, statically, and dynamically linkable library files are now produced with MSVC compilers. See <link linkend="date_time.buildinfo">Build/Compiler Information</link> for more details.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Time_duration from_string is now correctly constructed from a negative value. (ie "-0:39:00.000") Code provided by Bart Garst.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Fixed many MSVC compiler warnings when compiled with warning level 4.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Added prefix decrement operator (--) for date and time iterators. See <link linkend="date_time.posix_time.time_iterators">Time Iterators</link> and <link linkend="date_time.gregorian.date_iterators">Date Iterators</link> for more details. Code provided by Bart Garst.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Special_values functionality added for date_duration, time_duration and time classes. Code provided by Bart Garst.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>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.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>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 <link linkend="date_time.calculations">Calculations</link> has been improved.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Added typedefs to boost::gregorian gregorian_types.hpp various date_generator function classes.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Added from_time_t function to convert time_t to a ptime.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Added a span function for combining periods. See <link linkend="date_time.gregorian.date_period">date period</link> and <link linkend="date_time.posix_time.time_period">time period</link> docs.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>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</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Added output streaming operators for the <link linkend="date_time.gregorian.date_algorithms">date generator</link> classes - partial_date, first_kday_after, first_kday_before, etc. Thanks to Bart Garst for this work.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Added unary- operators for durations for reversing the sign of a time duration. For example:
|
|
<programlisting>
|
|
time_duration td(5,0,0); //5 hours
|
|
td = -td; //-5 hours</programlisting>
|
|
Thanks to Bart Garst for this work.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>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.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>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 <link linkend="date_time.gregorian.date">Date Class</link> for more details.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug-Fix</entry><!-- leave '-' so table cell doesn't wrap -->
|
|
<entry>Various documentation fixes. Thanks to Bart Garst for updates.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
|
|
<bridgehead renderas="sect3">Changes from Boost 1.29 to 1.30 (date_time 1.00 to 1.01)</bridgehead>
|
|
<para>
|
|
Notice: The interface to the partial_date class (see <link linkend="date_time.gregorian.algorithms">date_algorithms</link>) 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);
|
|
</para>
|
|
<informaltable frame="all">
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Type</entry>
|
|
<entry>Description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Added new experimental feature for Daylight Savings Time calculations. This allows traits based specification of dst rules.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Added new interfaces to calculate julian day and modified julian day to the gregorian date class. See <link linkend="date_time.gregorian.date">boost::gregorian::date</link>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Add new interface to calculate iso 8601 week number for a date. See <link linkend="date_time.gregorian.date">boost::gregorian::date</link>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry>Add an iso 8601 time date-time format (eg: YYYYMMDDTHHHMMSS) parsing function. See <link linkend="date_time.posix_time.ptime">Class ptime</link> for more information.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Feature</entry>
|
|
<entry> Added a length function to the period template so that both date_periods and time_periods will now support this function.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Split Jamfiles so that libs/date_time/build/Jamfile only builds library and /libs/date_time/libs/test/Jamfile which runs tests.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Fixed many minor documentation issues.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Removed the DATE_TIME_INLINE macro which was causing link errors. This macro is no longer needed in projects using the library.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Added missing typedef for year_iterator to gregorian_types.hpp</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug Fix</entry>
|
|
<entry>Fixed problem with gregorian ostream operators that prevented the use of wide streams.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>Bug-Fix</entry><!-- leave '-' so table cell doesn't wrap -->
|
|
<entry>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.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</section>
|