File: Poco.DateTimeFormatter.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (156 lines) | stat: -rw-r--r-- 12,734 bytes parent folder | download | duplicates (2)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::DateTimeFormatter</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1>
<h1 class="symbol">class DateTimeFormatter</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> DateTime<br />
<b>Header:</b> Poco/DateTimeFormatter.h</p>
<h2>Description</h2>
<div class="description">
<p>This class converts dates and times into strings, supporting a   variety of standard and custom formats. </p>
<p>There are two kind of static member functions: </p>
<ul>
<li>format* functions return a std::string containing the formatted value. </li>
<li>append* functions append the formatted value to an existing string. </li>
</ul>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.DateTimeFormatter.html#4514" title="Poco::DateTimeFormatter::append()">append</a>, <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">format</a>, <a href="Poco.DateTimeFormatter.html#4532" title="Poco::DateTimeFormatter::tzdISO()">tzdISO</a>, <a href="Poco.DateTimeFormatter.html#4534" title="Poco::DateTimeFormatter::tzdRFC()">tzdRFC</a></p>
<h2>Enumerations</h2>
<h3><i>Anonymous</i></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="4499">UTC</a> = 0xFFFF</p>
<div class="description">
<p>Special value for timeZoneDifferential denoting <a href="Poco.DateTimeFormatter.html#4499" title="Poco::DateTimeFormatter::UTC">UTC</a>.  </p>
</div>
<h2>Member Functions</h2>
<h3><a name="4514">append</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void append(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> &amp; timestamp,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt,<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential = UTC<br />);</p>
<div class="description">
<p>Formats the given timestamp according to the given format and appends it to str. </p>
<p>See <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">format</a>() for documentation of the formatting string. </p>
</div>
<h3><a name="4519">append</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void append(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt,<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential = UTC<br />);</p>
<div class="description">
<p>Formats the given date and time according to the given format and appends it to str. </p>
<p>See <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">format</a>() for documentation of the formatting string. </p>
</div>
<h3><a name="4524">append</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void append(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.LocalDateTime.html" title="class Poco::LocalDateTime">LocalDateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt<br />);</p>
<div class="description">
<p>Formats the given local date and time according to the given format and appends it to str. </p>
<p>See <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">format</a>() for documentation of the formatting string. </p>
</div>
<h3><a name="4528">append</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void append(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Timespan.html" title="class Poco::Timespan">Timespan</a> &amp; timespan,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt = "%dd %H:%M:%S.%i"<br />);</p>
<div class="description">
<p>Formats the given timespan according to the given format and appends it to str. </p>
<p>See <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">format</a>() for documentation of the formatting string. </p>
</div>
<h3><a name="4500">format</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static std::string format(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> &amp; timestamp,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt,<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential = UTC<br />);</p>
<div class="description">
<p>Formats the given timestamp according to the given format. The format string is used as a template to format the date and is copied character by character except for the following special characters, which are replaced by the corresponding value. </p>
<p></p>
<ul>
<li>%w - abbreviated weekday (Mon, Tue, ...) </li>
<li>%W - full weekday (Monday, Tuesday, ...) </li>
<li>%b - abbreviated month (Jan, Feb, ...) </li>
<li>%B - full month (January, February, ...) </li>
<li>%d - zero-padded day of month (01 .. 31) </li>
<li>%e - day of month (1 .. 31) </li>
<li>%f - space-padded day of month ( 1 .. 31) </li>
<li>%m - zero-padded month (01 .. 12) </li>
<li>%n - month (1 .. 12) </li>
<li>%o - space-padded month ( 1 .. 12) </li>
<li>%y - year without century (70) </li>
<li>%Y - year with century (1970) </li>
<li>%H - hour (00 .. 23) </li>
<li>%h - hour (00 .. 12) </li>
<li>%a - am/pm </li>
<li>%A - AM/PM </li>
<li>%M - minute (00 .. 59) </li>
<li>%S - second (00 .. 59) </li>
<li>%i - millisecond (000 .. 999) </li>
<li>%c - centisecond (0 .. 9) </li>
<li>%F - fractional seconds/microseconds (000000 - 999999) </li>
<li>%z - time zone differential in ISO 8601 format (Z or +NN.NN). </li>
<li>%Z - time zone differential in RFC format (GMT or +NNNN) </li>
<li>%% - percent sign </li>
</ul>
<p>Class <a href="Poco.DateTimeFormat.html" title="class Poco::DateTimeFormat">DateTimeFormat</a> defines format strings for various standard date/time formats. </p>
</div>
<h3><a name="4504">format</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static std::string format(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt,<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential = UTC<br />);</p>
<div class="description">
<p>Formats the given date and time according to the given format. See <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">format</a>(const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a>&amp;, const std::string&amp;, int) for more information. </p>
</div>
<h3><a name="4508">format</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static std::string format(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.LocalDateTime.html" title="class Poco::LocalDateTime">LocalDateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt<br />);</p>
<div class="description">
<p>Formats the given local date and time according to the given format. See <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">format</a>(const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a>&amp;, const std::string&amp;, int) for more information. </p>
</div>
<h3><a name="4511">format</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static std::string format(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.Timespan.html" title="class Poco::Timespan">Timespan</a> &amp; timespan,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt = "%dd %H:%M:%S.%i"<br />);</p>
<div class="description">
<p>Formats the given timespan according to the given format. The format string is used as a template to format the date and is copied character by character except for the following special characters, which are replaced by the corresponding value. </p>
<p></p>
<ul>
<li>%d - days </li>
<li>%H - hours	 (00 .. 23) </li>
<li>%h - total hours (0 .. n) </li>
<li>%M - minutes (00 .. 59) </li>
<li>%m - total minutes (0 .. n) </li>
<li>%S - seconds (00 .. 59) </li>
<li>%s - total seconds (0 .. n) </li>
<li>%i - milliseconds (000 .. 999) </li>
<li>%c - centisecond (0 .. 9) </li>
<li>%F - fractional seconds/microseconds (000000 - 999999) </li>
<li>%% - percent sign </li>
</ul>
</div>
<h3><a name="4532">tzdISO</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static std::string tzdISO(<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential<br />);</p>
<div class="description">
<p>Formats the given timezone differential in ISO format. If timeZoneDifferential is <a href="Poco.DateTimeFormatter.html#4499" title="Poco::DateTimeFormatter::UTC">UTC</a>, &quot;Z&quot; is returned, otherwise, +HH.MM (or -HH.MM) is returned. </p>
</div>
<h3><a name="4536">tzdISO</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void tzdISO(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential<br />);</p>
<div class="description">
<p>Formats the given timezone differential in ISO format and appends it to the given string. If timeZoneDifferential is <a href="Poco.DateTimeFormatter.html#4499" title="Poco::DateTimeFormatter::UTC">UTC</a>, &quot;Z&quot; is returned, otherwise, +HH.MM (or -HH.MM) is returned. </p>
</div>
<h3><a name="4534">tzdRFC</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" />  <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static std::string tzdRFC(<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential<br />);</p>
<div class="description">
<p>Formats the given timezone differential in RFC format. If timeZoneDifferential is <a href="Poco.DateTimeFormatter.html#4499" title="Poco::DateTimeFormatter::UTC">UTC</a>, &quot;GMT&quot; is returned, otherwise ++HHMM (or -HHMM) is returned. </p>
</div>
<h3><a name="4539">tzdRFC</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void tzdRFC(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;int timeZoneDifferential<br />);</p>
<div class="description">
<p>Formats the given timezone differential in RFC format and appends it to the given string. If timeZoneDifferential is <a href="Poco.DateTimeFormatter.html#4499" title="Poco::DateTimeFormatter::UTC">UTC</a>, &quot;GMT&quot; is returned, otherwise ++HHMM (or -HHMM) is returned. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>