Compare commits

...

5 Commits

Author SHA1 Message Date
nobody 891503f7b2 This commit was manufactured by cvs2svn to create tag
'Version_1_30_2'.

[SVN r19685]
2003-08-18 18:40:31 +00:00
Dave Abrahams 7c7407d890 Fix facet support for intel-win32
[SVN r19625]
2003-08-16 00:18:24 +00:00
Jeff Garland 397e093799 add missing file
[SVN r19405]
2003-08-02 18:03:00 +00:00
nobody 8710f998a1 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r19219]
2003-07-19 20:39:43 +00:00
nobody 858618e0da This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17693]
2003-03-01 19:43:06 +00:00
5 changed files with 221 additions and 43 deletions
+112
View File
@@ -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>&nbsp;<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&#64;crystalclearsoftware.com">Jeff Garland</a> &copy; 2000-2002
</small></address>
</body>
</html>
+18
View File
@@ -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;
};
+37
View File
@@ -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;
}
+24
View File
@@ -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;
}
+30 -43
View File
@@ -9,10 +9,17 @@ include testing.jam ;
# Make tests run by default.
DEPENDS all : test ;
rule date_time-run ( files + : requirements * )
{
# look in BOOST_ROOT for sources first, just in this Jamfile
local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ;
return [ run $(files) <lib>../build/boost_date_time : : : std::facet-support $(requirements) ] ;
}
rule date_time-prun ( files + : requirements * )
{
return [ date_time-run $(files) : $(requirements) <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ] ;
}
{
test-suite date_time_core
:
[ run testint_adapter.cpp ]
@@ -24,51 +31,31 @@ DEPENDS all : test ;
test-suite date_time_gregorian
:
[ run gregorian/testdate.cpp <lib>../build/boost_date_time ]
[ run gregorian/testdate_duration.cpp <lib>../build/boost_date_time ]
[ run gregorian/testperiod.cpp <lib>../build/boost_date_time ]
[ run gregorian/testdate_iterator.cpp <lib>../build/boost_date_time ]
[ run gregorian/testfacet.cpp <lib>../build/boost_date_time ]
[ run gregorian/testformatters.cpp <lib>../build/boost_date_time ]
[ run gregorian/testgenerators.cpp <lib>../build/boost_date_time ]
[ run gregorian/testgreg_cal.cpp <lib>../build/boost_date_time ]
[ run gregorian/testgreg_day.cpp <lib>../build/boost_date_time ]
[ run gregorian/testgreg_month.cpp <lib>../build/boost_date_time ]
[ run gregorian/testparse_date.cpp <lib>../build/boost_date_time ]
[ date_time-run gregorian/testdate.cpp ]
[ date_time-run gregorian/testdate_duration.cpp ]
[ date_time-run gregorian/testperiod.cpp ]
[ date_time-run gregorian/testdate_iterator.cpp ]
[ date_time-run gregorian/testfacet.cpp ]
[ date_time-run gregorian/testformatters.cpp ]
[ date_time-run gregorian/testgenerators.cpp ]
[ date_time-run gregorian/testgreg_cal.cpp ]
[ date_time-run gregorian/testgreg_day.cpp ]
[ date_time-run gregorian/testgreg_month.cpp ]
[ date_time-run gregorian/testparse_date.cpp ]
;
test-suite date_time_posixtime
:
[ run posix_time/testlocal_adjustor.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testc_local_adjustor.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testclock.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testdst_rules.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testduration.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testiterator.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testparse_time.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testperiod.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testtime.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ run posix_time/testmicrosec_time_clock.cpp
<lib>../build/boost_date_time
: : : <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ]
[ date_time-prun posix_time/testlocal_adjustor.cpp ]
[ date_time-prun posix_time/testc_local_adjustor.cpp ]
[ date_time-prun posix_time/testclock.cpp ]
[ date_time-prun posix_time/testdst_rules.cpp ]
[ date_time-prun posix_time/testduration.cpp ]
[ date_time-prun posix_time/testiterator.cpp ]
[ date_time-prun posix_time/testparse_time.cpp ]
[ date_time-prun posix_time/testperiod.cpp ]
[ date_time-prun posix_time/testtime.cpp ]
[ date_time-prun posix_time/testmicrosec_time_clock.cpp ]
;
}