summaryrefslogtreecommitdiff
path: root/doc/html/last_kday_of_month.html
blob: 2d48763547e45aabd716c0b5d5f0577fb7d93f4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Class template last_kday_of_month</title>
<link rel="stylesheet" href="boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="The Boost C++ Libraries">
<link rel="up" href="date_time/doxy.html#id1109842" title="Header &lt;boost/date_time/date_generators.hpp&gt;">
<link rel="prev" href="first_kday_of_month.html" title="Class template first_kday_of_month">
<link rel="next" href="first_kday_after.html" title="Class template first_kday_after">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.htm">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="../../people/people.htm">People</a></td>
<td align="center"><a href="../../more/faq.htm">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="first_kday_of_month.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id1109842"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="first_kday_after.html"><img src="images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="last_kday_of_month"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template last_kday_of_month</span></h2>
<p>boost::date_time::last_kday_of_month &#8212; Calculate something like Last Sunday of January. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> date_type&gt; 
<span class="bold"><strong>class</strong></span> last_kday_of_month
  :  : <span class="bold"><strong>public</strong></span> boost::date_time::year_based_generator&lt; date_type &gt;
{
<span class="bold"><strong>public</strong></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><strong>typedef</strong></span> date_type::calendar_type        calendar_type;   
  <span class="bold"><strong>typedef</strong></span> calendar_type::day_of_week_type day_of_week_type;
  <span class="bold"><strong>typedef</strong></span> calendar_type::month_type       month_type;      
  <span class="bold"><strong>typedef</strong></span> calendar_type::year_type        year_type;       
  <span class="bold"><strong>typedef</strong></span> date_type::duration_type        duration_type;   

  <span class="emphasis"><em>// <a href="last_kday_of_month.html#last_kday_of_monthconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="last_kday_of_month.html#id1078103-bb">last_kday_of_month</a>(day_of_week_type, month_type);

  <span class="emphasis"><em>// <a href="last_kday_of_month.html#id1110595-bb">public member functions</a></em></span>
  <span class="type">date_type</span> <a href="last_kday_of_month.html#id1110601-bb">get_date</a>(year_type) <span class="bold"><strong>const</strong></span>;
  <span class="type">month_type</span> <a href="last_kday_of_month.html#id1103665-bb">month</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type">day_of_week_type</span> <a href="last_kday_of_month.html#id1103678-bb">day_of_week</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a href="last_kday_of_month.html#id857894-bb">to_string</a>() <span class="bold"><strong>const</strong></span>;
};</pre></div>
<div class="refsect1" lang="en">
<a name="id1075425"></a><h2>Description</h2>
<p>Useful generator functor for finding holidays and daylight savings Get the last day of the month and then calculate the difference to the last previous day. 
</p>
<div class="refsect2" lang="en">
<a name="id1075433"></a><h3>
<a name="last_kday_of_monthconstruct-copy-destruct"></a><code class="computeroutput">last_kday_of_month</code> construct/copy/destruct</h3>
<div class="orderedlist"><ol type="1"><li>
<pre class="literallayout"><a name="id1078103-bb"></a>last_kday_of_month(day_of_week_type dow, month_type m);</pre>
<p></p>
<div class="variablelist">
<p class="title"><b>Parameters</b></p>
<dl>
<dt><span class="term">dow</span></dt>
<dd><p>The day of week, eg: Sunday, Monday, etc </p></dd>
<dt><span class="term">m</span></dt>
<dd><p>The month of the year, eg: Jan, Feb, Mar, etc </p></dd>
</dl>
</div>
</li></ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id1075489"></a><h3>
<a name="id1110595-bb"></a><code class="computeroutput">last_kday_of_month</code> public member functions</h3>
<div class="orderedlist"><ol type="1">
<li><pre class="literallayout"><span class="type">date_type</span> <a name="id1110601-bb"></a>get_date(year_type year) <span class="bold"><strong>const</strong></span>;</pre></li>
<li><pre class="literallayout"><span class="type">month_type</span> <a name="id1103665-bb"></a>month() <span class="bold"><strong>const</strong></span>;</pre></li>
<li><pre class="literallayout"><span class="type">day_of_week_type</span> <a name="id1103678-bb"></a>day_of_week() <span class="bold"><strong>const</strong></span>;</pre></li>
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a name="id857894-bb"></a>to_string() <span class="bold"><strong>const</strong></span>;</pre>
<p>Returns a string formatted as "M4.5.0" ==&gt; last Sunday in April. </p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="first_kday_of_month.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id1109842"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="first_kday_after.html"><img src="images/next.png" alt="Next"></a>
</div>
</body>
</html>