mirror of
https://github.com/boostorg/date_time.git
synced 2026-07-21 13:13:29 +00:00
Compare commits
4 Commits
develop
...
boost-1.30.1
| Author | SHA1 | Date | |
|---|---|---|---|
| f82a52948f | |||
| 397e093799 | |||
| 8710f998a1 | |||
| 858618e0da |
@@ -0,0 +1,112 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
||||
<title>Boost Date-Time Library Documentation</title>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href="../../../index.htm">
|
||||
<img align="left" src="../../../c++boost.gif" alt="C++ Boost">
|
||||
</a>
|
||||
|
||||
<h1>Boost Date-Time Change History</h1>
|
||||
<p>
|
||||
<p> <p>
|
||||
<hr>
|
||||
<a href="index.html">Overall Index</a>
|
||||
<p>
|
||||
<h3>Changes from Boost 1.29 to 1.30 (date_time 1.00 to 1.01)</h3>
|
||||
<p class="bold">
|
||||
Notice: The interface to the <font class="el">partial_date</font>
|
||||
class
|
||||
<a href="date_algorithms.html">(see date_algorithms)</a>
|
||||
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);
|
||||
<p>
|
||||
<table>
|
||||
<tr class="row_title"><td>Type</td><td>Description</td></tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Bug</td>
|
||||
<td>Added new experimental feature for Daylight Savings Time
|
||||
calculations. This allows traits based specification of
|
||||
dst rules.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Feature</td>
|
||||
<td>Added new interfaces to calculate julian day and modified
|
||||
julian day to the gregorian date class.
|
||||
See <a href="class_date.html#accessors">boost::gregorian::date</a>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Feature</td>
|
||||
<td>Add new interface to calculate iso 8601 week number for
|
||||
a date.
|
||||
See <a href="class_date.html#accessors">boost::gregorian::date</a>.
|
||||
</td>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Feature</td>
|
||||
<td>Add an iso 8601 time date-time format (eg: YYYYMMDDTHHHMMSS)
|
||||
parsing function.
|
||||
See <a href="class_ptime.html#constructfromstring">Class ptime</a> for more information.
|
||||
</td>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Feature</td>
|
||||
<td>Added a length function to the period template so that both
|
||||
date_periods and time_periods will now support this function.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Bug Fix</td>
|
||||
<td>Split Jamfiles so that libs/date_time/build/Jamfile
|
||||
only builds library and /libs/date_time/libs/test/Jamfile
|
||||
which runs tests.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Bug Fix</td>
|
||||
<td>Fixed many minor documentation issues.</td>
|
||||
</tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Bug Fix</td>
|
||||
<td>Removed the DATE_TIME_INLINE macro which was causing
|
||||
link errors. This macro is no longer needed in projects
|
||||
using the library.
|
||||
</td>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Bug Fix</td>
|
||||
<td>Added missing typedef for year_iterator to
|
||||
gregorian_types.hpp</td>
|
||||
</tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Bug Fix</td>
|
||||
<td>Fixed problem with gregorian ostream operators
|
||||
that prevented the use of wide streams.
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="content">
|
||||
<td class="nowrap">Bug Fix</td>
|
||||
<td>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.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
<address><small>
|
||||
<!-- hhmts start -->
|
||||
Last modified: Sat Aug 2 11:05:31 MST 2003
|
||||
<!-- hhmts end -->
|
||||
by <a href="mailto:jeff@crystalclearsoftware.com">Jeff Garland</a> © 2000-2002
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// This example displays the amount of time until new year's in days
|
||||
|
||||
#include "boost/date_time/gregorian/gregorian.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
||||
using namespace boost::gregorian;
|
||||
|
||||
date::ymd_type today = day_clock::local_day_ymd();
|
||||
date new_years_day(today.year + 1,1,1);
|
||||
date_duration dd = new_years_day - date(today);
|
||||
|
||||
std::cout << "Days till new year: " << dd.days() << std::endl;
|
||||
return 0;
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
// Simple program that uses the gregorian calendar to find the last
|
||||
// day of the month.
|
||||
|
||||
#include "boost/date_time/gregorian/gregorian.hpp"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
||||
std::cout << " Enter Year(ex: 2002): ";
|
||||
int year, month;
|
||||
std::cin >> year;
|
||||
std::cout << " Enter Month(1..12): ";
|
||||
std::cin >> month;
|
||||
try {
|
||||
int day = boost::gregorian::gregorian_calendar::end_of_month_day(year,month);
|
||||
boost::gregorian::date endOfMonth(year,month,day);
|
||||
std::cout << boost::gregorian::to_simple_string(endOfMonth) << std::endl;
|
||||
|
||||
//Iterate thru by months --
|
||||
boost::gregorian::month_iterator mitr(endOfMonth,1);
|
||||
boost::gregorian::date startOfNextYear(year+1,1,1);
|
||||
//loop thru the days and print each one
|
||||
while (mitr < startOfNextYear){
|
||||
std::cout << boost::gregorian::to_simple_string(*mitr) << std::endl;
|
||||
++mitr;
|
||||
}
|
||||
|
||||
}
|
||||
catch(...) {
|
||||
std::cout << "Invalid Date Entered" << std::endl;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
// Simple program that uses the gregorian calendar to find the last
|
||||
// day of the month.
|
||||
|
||||
#include "boost/date_time/gregorian/gregorian.hpp"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
||||
using namespace boost::gregorian;
|
||||
typedef boost::date_time::month_functor<date> add_month;
|
||||
|
||||
date d = day_clock::local_day();
|
||||
add_month mf(1);
|
||||
date d2 = d + mf.get_offset(d);
|
||||
std::cout << to_simple_string(d2) << std::endl;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user