boost-react-native-bundle
Version:
Boost library as in https://sourceforge.net/projects/boost/files/boost/1.57.0/
986 lines (980 loc) • 109 kB
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Date Time Input/Output</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../date_time.html" title="Chapter 9. Boost.Date_Time">
<link rel="prev" href="local_time.html" title="Local Time">
<link rel="next" href="serialization.html" title="Serialization">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="local_time.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../date_time.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="serialization.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="date_time.date_time_io"></a>Date Time Input/Output</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="date_time_io.html#date_time.format_flags">Format Flags</a></span></dt>
<dt><span class="section"><a href="date_time_io.html#date_time.date_facet">Date Facet</a></span></dt>
<dt><span class="section"><a href="date_time_io.html#date_time.date_input_facet">Date Input Facet</a></span></dt>
<dt><span class="section"><a href="date_time_io.html#date_time.time_facet">Time Facet</a></span></dt>
<dt><span class="section"><a href="date_time_io.html#date_time.time_input_facet">Time Input Facet</a></span></dt>
<dt><span class="section"><a href="date_time_io.html#date_time.io_objects">Date Time Formatter/Parser Objects</a></span></dt>
<dt><span class="section"><a href="date_time_io.html#date_time.io_tutorial">Date Time IO Tutorial</a></span></dt>
</dl></div>
<h3>
<a name="idp179854336"></a>Date Time IO System</h3>
<p>
<a class="link" href="date_time_io.html#streaming_exceptions">Exception Handling on Streams</a>
</p>
<p>As of version 1.33, the date_time library utilizes a new IO streaming system. This new system gives the user great control over how dates and times can be represented. The customization options can be broken down into two groups: format flags and string elements. Format flags provide flexibility in the order of the date elements as well as the type. Customizing the string elements allows the replacement of built in strings from month names, weekday names, and other strings used in the IO.</p>
<p>The output system is based on a date_facet (derived from std::facet), while the input system is based on a date_input_facet (also derived from std::facet). The time and local_time facets are derived from these base types. The output system utilizes three formatter objects, whereas the input system uses four parser objects. These formatter and parser objetcs are also customizable.</p>
<p>It is important to note, that while all the examples shown here use narrow streams, there are wide stream facets available as well (see <a class="link" href="date_time_io.html#io_objects_table">IO Objects</a> for a complete list).</p>
<p>It should be further noted that not all compilers are capable of using this IO system. For those compilers the IO system used in previous <code class="computeroutput">date_time</code> versions is still available. The "legacy IO" is automatically selected for these compilers, however, the legacy IO system can be manually selected by defining <code class="computeroutput">USE_DATE_TIME_PRE_1_33_FACET_IO</code>. See the <a class="link" href="details.html#date_time.buildinfo" title="Build-Compiler Information">Build-Compiler Information</a> for more information.</p>
<a name="streaming_exceptions"></a><h6>
<a name="idp179863344"></a>Exception Handling on Streams</h6>
<p>When an error occurs during the input streaming process, the <code class="computeroutput">std::ios_base::failbit</code> will (always) be set on the stream. It is also possible to have exceptions thrown when an error occurs. To "turn on" these exceptions, call the stream's <code class="computeroutput">exceptions</code> function with a parameter of <code class="computeroutput">std::ios_base::failbit</code>.</p>
<pre class="screen">// "Turning on" exceptions
date d(not_a_date_time);
std::stringstream ss;
ss.exceptions(std::ios_base::failbit);
ss.str("204-Jan-01");
ss >> d; // throws bad_year exception AND sets failbit on stream</pre>
<h6>
<a name="idp179867712"></a>A simple example of this new system:</h6>
<pre class="screen">//example to customize output to be "LongWeekday LongMonthname day, year"
// "%A %b %d, %Y"
date d(2005,Jun,25);
date_facet* facet(new date_facet("%A %B %d, %Y"));
std::cout.imbue(std::locale(std::cout.getloc(), facet));
std::cout << d << std::endl;
// "Saturday June 25, 2005"</pre>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="date_time.format_flags"></a>Format Flags</h3></div></div></div>
<p>Many of the format flags this new system uses for output are those used by <code class="computeroutput">strftime(...)</code>, but not all. Some new flags have been added, and others overridden. The input system supports only specific flags, therefore, not all flags that work for output will work with input (we are currently working to correct this situation).</p>
<p>The following tables list the all the flags available for both date_time IO as well as strftime. Format flags marked with a single asterisk (*) have a behavior unique to date_time. Those flags marked with an exclamation point (!) are not usable for input (at this time). The flags marked with a hash sign (#) are implemented by system locale and are known to be missing on some platforms. The first table is for dates, and the second table is for times.
</p>
<p>
<a name="date_time_io.date_format_flags"></a>
Date Facet Format Flags
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th rowspan="2" valign="top">Format Specifier</th>
<th>Description</th>
</tr>
<tr><th>Example</th></tr>
</thead>
<tbody>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%a</pre></td>
<td>Abbreviated weekday name</td>
</tr>
<tr><td><pre class="screen">"Mon" => Monday</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%A</pre></td>
<td>Long weekday name</td>
</tr>
<tr><td><pre class="screen">"Monday"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%b</pre></td>
<td>Abbreviated month name</td>
</tr>
<tr><td><pre class="screen">"Feb" => February</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%B</pre></td>
<td>Full month name</td>
</tr>
<tr><td><pre class="screen">"February"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%c !</pre></td>
<td>The preferred date and time representation for the current locale.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%C !#</pre></td>
<td>The century number (year/100) as a 2-digit integer.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%d</pre></td>
<td>Day of the month as decimal 01 to 31</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%D !#</pre></td>
<td>Equivalent to %m/%d/%y</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%e #</pre></td>
<td>Like %d, the day of the month as a decimal number, but a leading zero is replaced by a space</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%G !</pre></td>
<td>This has the same format and value as %y, except that if the ISO week number belongs to the previous or next year, that year is used instead.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%g !</pre></td>
<td>Like %G, but without century.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%h !#</pre></td>
<td> Equivalent to %b</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%j</pre></td>
<td>Day of year as decimal from 001 to 366 for leap years, 001 - 365 for non-leap years.</td>
</tr>
<tr><td><pre class="screen">"060" => Feb-29</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%m</pre></td>
<td>Month name as a decimal 01 to 12</td>
</tr>
<tr><td><pre class="screen">"01" => January</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%u !</pre></td>
<td>The day of the week as a decimal, range 1 to 7, Monday being 1.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%U</pre></td>
<td>The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. In 2005, Jan 1st falls on a Saturday, so therefore it falls within week 00 of 2005 (week 00 spans 2004-Dec-26 to 2005-Jan-01. This also happens to be week 53 of 2004).</td>
</tr>
<tr><td><pre class="screen">date d(2005, Jan, 1); // Saturday
// with format %U
ss << d; // "00"
d += day(1); // Sunday
ss << d; // "01" beginning of week 1</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%V !#</pre></td>
<td>The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%w</pre></td>
<td>Weekday as decimal number 0 to 6</td>
</tr>
<tr><td><pre class="screen">"0" => Sunday</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%W</pre></td>
<td>Week number 00 to 53 where Monday is first day of week 1</td>
</tr>
<tr><td><pre class="screen">date d(2005, Jan, 2); // Sunday
// with format %W
ss << d; // "00"
d += day(1); // Monday
ss << d; // "01" beginning of week 1</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%x</pre></td>
<td>Implementation defined date format from the locale.</td>
</tr>
<tr><td><pre class="screen">date d(2005,Oct,31);
date_facet* f = new date_facet("%x");
locale loc = locale(locale("en_US"), f);
cout.imbue(loc);
cout << d; // "10/31/2005"
loc = locale(locale("de_DE"), f);
cout.imbue(loc);
cout << d; // "31.10.2005"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%y</pre></td>
<td>Two digit year</td>
</tr>
<tr><td><pre class="screen">"05" => 2005</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y</pre></td>
<td>Four digit year</td>
</tr>
<tr><td><pre class="screen">"2005"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y-%b-%d</pre></td>
<td>Default date format</td>
</tr>
<tr><td><pre class="screen">"2005-Apr-01"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y%m%d</pre></td>
<td>ISO format</td>
</tr>
<tr><td><pre class="screen">"20050401"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y-%m-%d</pre></td>
<td>ISO extended format</td>
</tr>
<tr><td><pre class="screen">"2005-04-01"</pre></td></tr>
</tbody>
</table></div>
<p>
<a name="date_time_io.time_format_flags"></a>
Time Facet Format Flags
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th rowspan="2" valign="top">Format Specifier</th>
<th>Description</th>
</tr>
<tr><th>Example</th></tr>
</thead>
<tbody>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%- *!</pre></td>
<td>Placeholder for the sign of a duration. Only displays when the duration is negative.</td>
</tr>
<tr><td><pre class="screen">"-13:15:16"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%+ *!</pre></td>
<td>Placeholder for the sign of a duration. Always displays for both positive and negative.</td>
</tr>
<tr><td><pre class="screen">"+13:15:16"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%f</pre></td>
<td>Fractional seconds are always used, even when their value is zero</td>
</tr>
<tr><td><pre class="screen">"13:15:16.000000"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%F *</pre></td>
<td>Fractional seconds are used only when their value is not zero.</td>
</tr>
<tr><td><pre class="screen">"13:15:16"
"05:04:03.001234"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%H</pre></td>
<td>The hour as a decimal number using a 24-hour clock (range 00 to 23).</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%I !</pre></td>
<td>The hour as a decimal number using a 12-hour clock (range 01 to 12).</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%k !</pre></td>
<td>The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank.</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%l !</pre></td>
<td>The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank.</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%M</pre></td>
<td>The minute as a decimal number (range 00 to 59).</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%O</pre></td>
<td>The number of hours in a time duration as a decimal number (range 0 to max. representable duration); single digits are preceded by a zero.</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%p !</pre></td>
<td>Either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale.</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%P !#</pre></td>
<td>Like %p but in lowercase: `am' or `pm' or a corresponding string for the current locale.</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%r !#</pre></td>
<td>The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to `%I:%M:%S %p'</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%R !</pre></td>
<td>The time in 24-hour notation (%H:%M)</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%s *</pre></td>
<td>Seconds with fractional seconds.</td>
</tr>
<tr><td><pre class="screen">"59.000000"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%S</pre></td>
<td>Seconds only</td>
</tr>
<tr><td><pre class="screen">"59"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%T !</pre></td>
<td>The time in 24-hour notation (%H:%M:%S)</td>
</tr>
<tr><td> </td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%q</pre></td>
<td>ISO time zone (output only). This flag is ignored when using the time_facet with a ptime.</td>
</tr>
<tr><td><pre class="screen">"-0700" // Mountain Standard Time</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Q</pre></td>
<td>ISO extended time zone (output only). This flag is ignored when using the time_facet with a ptime.</td>
</tr>
<tr><td><pre class="screen">"-05:00" // Eastern Standard Time</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%z *!</pre></td>
<td>Abbreviated time zone (output only). This flag is ignored when using the time_facet with a ptime.</td>
</tr>
<tr><td><pre class="screen">"MST" // Mountain Standard Time</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Z *!</pre></td>
<td>Full time zone name (output only). This flag is ignored when using the time_facet with a ptime.</td>
</tr>
<tr><td><pre class="screen">"EDT" // Eastern Daylight Time</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%ZP *</pre></td>
<td>Posix time zone string (available to both input and output). This flag is ignored when using the time_facet with a ptime. For complete details on posix time zone strings, see <a class="link" href="local_time.html#date_time.local_time.posix_time_zone" title="Posix Time Zone">posix_time_zone class</a>.</td>
</tr>
<tr><td><pre class="screen">"EST-05EDT+01,M4.1.0/02:00,M10.5.0/02:00"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%x %X</pre></td>
<td>Implementation defined date/time format from the locale.</td>
</tr>
<tr><td><pre class="screen">date d(2005,Oct,31);
ptime pt(d, hours(20));
time_facet* f = new time_facet("%x %X");
locale loc = locale(locale("en_US"), f);
cout.imbue(loc);
cout << pt; // "10/31/2005 08:00:00 PM"
loc = locale(locale("de_DE"), f);
cout.imbue(loc);
cout << pt; // "31.10.2005 20:00:00"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y%m%dT%H%M%S%F%q</pre></td>
<td>ISO format</td>
</tr>
<tr><td><pre class="screen">"20051015T131211-0700" // Oct 15, 2005 13:12:11 MST</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y-%m-%d %H:%M:%S%F%Q</pre></td>
<td>Extended ISO format</td>
</tr>
<tr><td><pre class="screen">"2005-10-15 13:12:11-07:00"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y-%b-%d %H:%M:%S%F %z</pre></td>
<td>Default format used when outputting ptime and local_date_time.</td>
</tr>
<tr><td><pre class="screen">"2005-Oct-15 13:12:11 MST"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%Y-%b-%d %H:%M:%S%F %ZP</pre></td>
<td>Default format used when inputting ptime and local_date_time.</td>
</tr>
<tr><td><pre class="screen">"2005-Oct-15 13:12:11 MST-07"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%-%H:%M:%S%F !</pre></td>
<td>Default time_duration format for output. Sign will only be displayed for negative durations.</td>
</tr>
<tr><td><pre class="screen">"-13:14:15.003400"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">%H:%M:%S%F</pre></td>
<td>Default time_duration format for input.</td>
</tr>
<tr><td><pre class="screen">"13:14:15.003400"</pre></td></tr>
</tbody>
</table></div>
<p>
</p>
<p>* Signifies flags that have a behavior unique to <code class="computeroutput">date_time</code>.</p>
<p># Signifies flags that have a platform-dependent behavior. These may not be supported everywhere.</p>
<p>! Signifies flags that currently do not work for input.</p>
</div>
<p>The following table lists the available facets.</p>
<a name="io_objects_table"></a><h4>
<a name="idp180062528"></a>IO Objects</h4>
<p>
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>Output</th>
<th>Input</th>
</tr></thead>
<tbody>
<tr>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/date_facet.html" title="Class template date_facet">date_facet</a></code></td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/date_input_facet.html" title="Class template date_input_facet">date_input_facet</a></code></td>
</tr>
<tr>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/date_facet.html" title="Class template date_facet">wdate_facet</a></code></td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/date_input_facet.html" title="Class template date_input_facet">wdate_input_facet</a></code></td>
</tr>
<tr>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/time_facet.html" title="Class template time_facet">time_facet</a></code></td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/time_input_facet.html" title="Class template time_input_facet">time_input_facet</a></code></td>
</tr>
<tr>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/time_facet.html" title="Class template time_facet">wtime_facet</a></code></td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/time_input_facet.html" title="Class template time_input_facet">wtime_input_facet</a></code></td>
</tr>
<tr>
<td>
<code class="computeroutput"><a class="link" href="../boost/date_time/time_facet.html" title="Class template time_facet">local_time_facet</a></code>*</td>
<td>
<code class="computeroutput"><a class="link" href="../boost/date_time/time_input_facet.html" title="Class template time_input_facet">local_time_input_facet</a></code>*</td>
</tr>
<tr>
<td>
<code class="computeroutput"><a class="link" href="../boost/date_time/time_facet.html" title="Class template time_facet">wlocal_time_facet</a></code>*</td>
<td>
<code class="computeroutput"><a class="link" href="../boost/date_time/time_input_facet.html" title="Class template time_input_facet">wlocal_time_input_facet</a></code>*</td>
</tr>
</tbody>
</table></div>
<p>
* These links lead to the <code class="computeroutput">time_facet</code> and <code class="computeroutput">time_input_facet</code> reference sections. They are not actual classes but typedefs.
</p>
<h4>
<a name="idp180088080"></a>Formatter/Parser Objects</h4>
<p>To implement the new i/o facets the date-time library uses a number of new parsers and formatters. These classes are available for users that want to implement specialized input/output routines.</p>
<p>
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>Output</th>
<th>Input</th>
</tr></thead>
<tbody>
<tr>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/period_formatter.html" title="Class template period_formatter">period_formatter</a></code></td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/period_parser.html" title="Class template period_parser">period_parser</a></code></td>
</tr>
<tr>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/date_generator_formatter.html" title="Class template date_generator_formatter">date_generator_formatter</a></code></td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/date_generator_parser.html" title="Class template date_generator_parser">date_generator_parser</a></code></td>
</tr>
<tr>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/special_values_formatter.html" title="Class template special_values_formatter">special_values_formatter</a></code></td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/special_values_parser.html" title="Class template special_values_parser">special_values_parser</a></code></td>
</tr>
<tr>
<td> </td>
<td><code class="computeroutput"><a class="link" href="../boost/date_time/format_date_parser.html" title="Class template format_date_parser">format_date_parser</a></code></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="date_time.date_facet"></a>Date Facet</h3></div></div></div>
<a class="link" href="date_time_io.html#date_facet_intro">Introduction</a> -
<a class="link" href="date_time_io.html#date_facet_constr">Construction</a> -
<a class="link" href="date_time_io.html#date_facet_accessors">Accessors</a><a name="date_facet_intro"></a><h4>
<a name="idp180110384"></a>Introduction</h4>
<p>The <code class="computeroutput">boost::date_time::date_facet</code> enables users to have significant control over the output streaming of dates (and other gregorian objects). The date_facet is typedef'd in the <code class="computeroutput">gregorian</code> namespace as <code class="computeroutput">date_facet</code> and <code class="computeroutput">wdate_facet</code>.
</p>
<a name="date_facet_constr"></a><h4>
<a name="idp180115200"></a>Construction</h4>
<p>
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>Syntax</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td valign="top"><pre class="screen">date_facet()</pre></td>
<td>Default constructor</td>
</tr>
<tr>
<td valign="top"><pre class="screen">date_facet(...)
Parameters:
char_type* format
input_collection_type</pre></td>
<td>Format given will be used for date output. All other formats will use their defaults. Collection is the set of short names to be used for months. All other name collections will use their defaults.</td>
</tr>
<tr>
<td valign="top"><pre class="screen">date_facet(...)
Parameters:
char_type* format
period_formatter_type
special_values_formatter_type
date_gen_formatter_type</pre></td>
<td>Format given will be used for date output. The remaining parameters are formatter objects. Further details on these objects can be found <a class="link" href="date_time_io.html#date_time.io_objects" title="Date Time Formatter/Parser Objects">here</a>. This constructor also provides default arguments for all parameters except the format. Therefore, <code class="computeroutput">date_facet("%m %d %Y")</code> will work.</td>
</tr>
</tbody>
</table></div>
<p>
</p>
<a name="date_facet_accessors"></a><h4>
<a name="idp180128064"></a>Accessors</h4>
<p>
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th rowspan="2" valign="top">Syntax</th>
<th>Description</th>
</tr>
<tr><th>Example</th></tr>
</thead>
<tbody>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void format(char_type*)</pre></td>
<td>Set the format for dates.</td>
</tr>
<tr><td><pre class="screen">date_facet* f = new date_facet();
f->format("%m %d %Y");</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void set_iso_format()</pre></td>
<td>Sets the date format to ISO</td>
</tr>
<tr><td><pre class="screen">f->set_iso_format();
// "%Y%m%d"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void set_iso_extended_format()</pre></td>
<td>Sets the date format to ISO Extended</td>
</tr>
<tr><td><pre class="screen">f->set_iso_extended_format();
// "%Y-%m-%d"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void month_format(char_type*)</pre></td>
<td>Set the format for months when they are 'put' individually.</td>
</tr>
<tr><td><pre class="screen">f->month_format("%B");
ss << greg_month(12); // "December"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void weekday_format(char_type*)</pre></td>
<td>Set the format for weekdays when they are 'put' individually.</td>
</tr>
<tr><td><pre class="screen">f->weekday_format("%a");
ss << greg_weekday(2); // "Tue"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void period_formatter(...)
Parameter:
period_formatter_type</pre></td>
<td>Replaces the period formatter object with a user created one.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void special_values_formatter(...)
Parameter:
special_values_formatter_type</pre></td>
<td>Replaces the special_values formatter object with a user created one.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void date_gen_phrase_strings(...)
Parameters:
input_collection_type
date_gen_formatter_type::
phrase_elements</pre></td>
<td>Sets new date generator phrase strings in date_gen_formatter. The input collection is a vector of strings (for details on these strings see <a class="link" href="date_time_io.html#io_objects.date_generators">date generator formatter/parser documentation</a>). The phrase_elements parameter is an enum, defined in the date_generator_formatter object, that has a default value of 'first'. It is used to indicate what the position of the first string in the collection will be.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void short_weekday_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'putting' short weekdays.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void long_weekday_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'putting' long weekdays.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void short_month_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'putting' short months.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void long_month_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'putting' long months.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(...)
Common parameters for all
'put' functions:
OutItrT
ios_base
char_type
Unique parameter for 'put' funcs:
gregorian object</pre></td>
<td>There are 12 put functions in the date_facet. The common paraeters are: an iterator pointing to the next item in the stream, an ios_base object, and the fill character. Each unique gregorian object has it's own put function. Each unique put function is described below.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., date)</pre></td>
<td>Puts a date object into the stream using the format set by <code class="computeroutput">format(...)</code> or the default.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., days)</pre></td>
<td>Puts a days object into the stream as a number.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., month)</pre></td>
<td>Puts a month object into the stream using the format set by <code class="computeroutput">month_format(...)</code> or the default.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., day)</pre></td>
<td>Puts a day of month object into the stream as a two digit number.</td>
</tr>
<tr><td><pre class="screen">"01" // January 1st</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., day_of_week)</pre></td>
<td>Puts a day of week object into the stream using the format set by <code class="computeroutput">weekday_format(...)</code> or the default.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., date_period)</pre></td>
<td>Puts a date_period into the stream. The format of the dates will use the format set by <code class="computeroutput">format(..)</code> or the default date format. The type of period (open or closed range) and the delimiters used are those used by the period_formatter.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., partial_date)</pre></td>
<td>Puts a partial_date date_generator object into the stream. The month format used is set by <code class="computeroutput">month_format(..)</code> or the default. The day of month is represented as a two digit number.</td>
</tr>
<tr><td><pre class="screen">"01 Jan" // default formats
"01 January" // long month format</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., date_generator)
Date Generator Type:
nth_day_of_the_week_in_month</pre></td>
<td>Puts a nth_day_of_the_week_in_month object into the stream. The month format is set by <code class="computeroutput">month_format(...)</code> or the default. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_formatter</a>.</td>
</tr>
<tr><td><pre class="screen">"third Fri in May" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., date_generator)
Date Generator Type:
first_day_of_the_week_in_month</pre></td>
<td>Puts a first_day_of_the_week_in_month object into the stream. The month format is set by <code class="computeroutput">month_format(...)</code> or the default. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_formatter</a>.</td>
</tr>
<tr><td><pre class="screen">"first Wed of Jun" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., date_generator)
Date Generator Type:
last_day_of_the_week_in_month</pre></td>
<td>Puts a last_day_of_the_week_in_month object into the stream. The month format is set by <code class="computeroutput">month_format(...)</code> or the default. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_formatter</a>.</td>
</tr>
<tr><td><pre class="screen">"last Tue of Mar" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., date_generator)
Date Generator Type:
first_day_of_the_week_after</pre></td>
<td>Puts a first_day_of_the_week_after object into the stream. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_formatter</a>.</td>
</tr>
<tr><td><pre class="screen">"first Sat after" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">OutItrT put(..., date_generator)
Date Generator Type:
first_day_of_the_week_before</pre></td>
<td>Puts a first_day_of_the_week_before object into the stream. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_formatter</a>.</td>
</tr>
<tr><td><pre class="screen">"first Mon before" // defaults</pre></td></tr>
</tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="date_time.date_input_facet"></a>Date Input Facet</h3></div></div></div>
<a class="link" href="date_time_io.html#date_input_facet_intro">Introduction</a> -
<a class="link" href="date_time_io.html#date_input_facet_constr">Construction</a> -
<a class="link" href="date_time_io.html#date_input_facet_accessors">Accessors</a><a name="date_input_facet_intro"></a><h4>
<a name="idp180241216"></a>Introduction</h4>
<p>The <code class="computeroutput">boost::date_time::date_input_facet</code> enables users to have significant control how dates (and other gregorian objects) are streamed in. The date_input_facet is typedef'd in the <code class="computeroutput">gregorian</code> namespace as <code class="computeroutput">date_input_facet</code> and <code class="computeroutput">wdate_input_facet</code>.
</p>
<a name="date_input_facet_constr"></a><h4>
<a name="idp180245984"></a>Construction</h4>
<p>
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>Syntax</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td valign="top"><pre class="screen">date_input_facet()</pre></td>
<td>Default constructor</td>
</tr>
<tr>
<td valign="top"><pre class="screen">date_input_facet(string_type format)</pre></td>
<td>Format given will be used for date input. All other formats will use their defaults.</td>
</tr>
<tr>
<td valign="top"><pre class="screen">date_input_facet(...)
Parameters:
string_type format
format_date_parser_type
special_values_parser_type
period_parser_type
date_gen_parser_type</pre></td>
<td>Format given will be used for date input. The remaining parameters are parser objects. Further details on these objects can be found <a class="link" href="date_time_io.html#date_time.io_objects" title="Date Time Formatter/Parser Objects">here</a>.</td>
</tr>
</tbody>
</table></div>
<p>
</p>
<a name="date_input_facet_accessors"></a><h4>
<a name="idp180257728"></a>Accessors</h4>
<p>
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th rowspan="2" valign="top">Syntax</th>
<th>Description</th>
</tr>
<tr><th>Example</th></tr>
</thead>
<tbody>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void format(char_type*)</pre></td>
<td>Set the format for dates.</td>
</tr>
<tr><td><pre class="screen">date_input_facet* f =
new date_input_facet();
f->format("%m %d %Y");</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void set_iso_format()</pre></td>
<td>Sets the date format to ISO</td>
</tr>
<tr><td><pre class="screen">f->set_iso_format();
// "%Y%m%d"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void set_iso_extended_format()</pre></td>
<td>Sets the date format to ISO Extended</td>
</tr>
<tr><td><pre class="screen">f->set_iso_extended_format();
// "%Y-%m-%d"</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void month_format(char_type*)</pre></td>
<td>Set the format when 'get'ing months individually.</td>
</tr>
<tr><td><pre class="screen">f->month_format("%B");
ss.str("March");
ss >> m; // March</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void weekday_format(char_type*)</pre></td>
<td>Set the format when 'get'ing weekdays individually.</td>
</tr>
<tr><td><pre class="screen">f->weekday_format("%a");
ss.str("Sun");
ss >> wd; // Sunday</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void year_format(char_type*)</pre></td>
<td>Set the format when 'get'ing years individually.</td>
</tr>
<tr><td><pre class="screen">f->weekday_format("%y");
ss.str("04");
ss >> year; // 2004</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void period_parser(...)
Parameter:
period_parser_type</pre></td>
<td>Replaces the period parser object with a user created one.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void special_values_parser(...)
Parameter:
special_values_parser_type</pre></td>
<td>Replaces the special_values parser object with a user created one.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void date_gen_phrase_strings(...)
Parameters:
input_collection_type</pre></td>
<td>Sets new date generator phrase strings in date_gen_parser. The input collection is a vector of strings (for details on these strings see <a class="link" href="date_time_io.html#io_objects.date_generators">date generator formatter/parser documentation</a>).</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void short_weekday_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'getting' short weekdays.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void long_weekday_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'getting' long weekdays.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void short_month_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'getting' short months.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">void long_month_names(...)
Parameter:
input_collection_type</pre></td>
<td>Replace strings used when 'getting' long months.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(...)
Common parameters for all
'get' functions:
InItrT from
InItrT to
ios_base
Unique parameter for 'get' funcs:
gregorian object</pre></td>
<td>There are 13 get functions in the date_input_facet. The common parameters are: an iterator pointing to the begining of the stream, an iterator pointing to the end of the stream, and an ios_base object. Each unique gregorian object has it's own get function. Each unique get function is described below.</td>
</tr>
<tr><td><pre class="screen"></pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., date)</pre></td>
<td>Gets a date object from the stream using the format set by <code class="computeroutput">format(...)</code> or the default.</td>
</tr>
<tr><td><pre class="screen">ss.str("2005-Jan-01");
ss >> d; // default format</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., month)</pre></td>
<td>Gets a month object from the stream using the format set by <code class="computeroutput">month_format(...)</code> or the default.</td>
</tr>
<tr><td><pre class="screen">ss.str("Feb");
ss >> m; // default format</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., day_of_week)</pre></td>
<td>Gets a day of week object from the stream using the format set by <code class="computeroutput">weekday_format(...)</code> or the default.</td>
</tr>
<tr><td><pre class="screen">ss.str("Sun");
ss >> dow; // default format</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., day)</pre></td>
<td>Gets a day of month object from the stream as a two digit number.</td>
</tr>
<tr><td><pre class="screen">"01" // January 1st</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., year)</pre></td>
<td>Gets a year object from the stream as a number. The number of expected digits depends on the year format.</td>
</tr>
<tr><td><pre class="screen">ss/str("2005");
ss >> y; // default format</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., days)</pre></td>
<td>Gets a days object from the stream as a number.</td>
</tr>
<tr><td><pre class="screen">ss.str("356");
ss >> dys; // a full year</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., date_period)</pre></td>
<td>Gets a date_period from the stream. The format of the dates will use the format set by <code class="computeroutput">format(..)</code> or the default date format. The type of period (open or closed range) and the delimiters used are those used by the period_parser.</td>
</tr>
<tr><td>see the <a class="link" href="date_time_io.html#date_time.io_tutorial" title="Date Time IO Tutorial">tutorial</a> for a complete example.</td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., partial_date)</pre></td>
<td>Gets a partial_date date_generator object from the stream. The month format used is set by <code class="computeroutput">month_format(..)</code> or the default. The day of month is represented as a two digit number.</td>
</tr>
<tr><td><pre class="screen">"01 Jan" // default formats
"01 January" // long month format</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., date_generator)
Date Generator Type:
nth_day_of_the_week_in_month</pre></td>
<td>Gets a nth_day_of_the_week_in_month object from the stream. The month format is set by <code class="computeroutput">month_format(...)</code> or the default. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_parser</a>.</td>
</tr>
<tr><td><pre class="screen">"third Fri in May" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., date_generator)
Date Generator Type:
first_day_of_the_week_in_month</pre></td>
<td>Gets a first_day_of_the_week_in_month object from the stream. The month format is set by <code class="computeroutput">month_format(...)</code> or the default. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_parser</a>.</td>
</tr>
<tr><td><pre class="screen">"first Wed of Jun" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., date_generator)
Date Generator Type:
last_day_of_the_week_in_month</pre></td>
<td>Gets a last_day_of_the_week_in_month object from the stream. The month format is set by <code class="computeroutput">month_format(...)</code> or the default. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_parser</a>.</td>
</tr>
<tr><td><pre class="screen">"last Tue of Mar" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., date_generator)
Date Generator Type:
first_day_of_the_week_after</pre></td>
<td>Gets a first_day_of_the_week_after object from the stream. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_parser</a>.</td>
</tr>
<tr><td><pre class="screen">"first Sat after" // defaults</pre></td></tr>
<tr>
<td rowspan="2" valign="top"><pre class="screen">InItrT get(..., date_generator)
Date Generator Type:
first_day_of_the_week_before</pre></td>
<td>Gets a first_day_of_the_week_before object from the stream. The weekday format is set by <code class="computeroutput">weekday_format(...)</code> or the default. The remaining phrase elements are set in the <a class="link" href="date_time_io.html#io_objects.date_generators">date_generator_parser</a>.</td>
</tr>
<tr><td><pre class="screen">"first Mon before" // defaults</pre></td></tr>
</tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="date_time.time_facet"></a>Time Facet</h3></div></div></div>
<a class="link" href="date_time_io.html#time_facet_intro">Introduction</a> -
<a class="link" href="date_time_io.html#time_facet_constr">Construction</a> -
<a class="link" href="date_time_io.html#time_facet_accessors">Accessors</a><a name="time_facet_intro"></a><h4>
<a name="idp180378512"></a>Introduction</h4>
<p>The <code class="computeroutput">boost::date_time::time_facet</code> is an extension of the <code class="computeroutput">boost::date_time::date_facet</code>. The time_facet is typedef'ed in the <code class="computeroutput">posix_time</code> namespace as <code class="computeroutput">time_facet</code> and <code class="computeroutput">wtime_facet</code>. It is typedef'd in the <code class="computeroutput">local_tim