File: Poco.DateTimeParser.html

package info (click to toggle)
poco-doc 1.3.6-1.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 10,080 kB
  • sloc: makefile: 31
file content (89 lines) | stat: -rw-r--r-- 11,723 bytes parent folder | download | duplicates (3)
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
<!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::DateTimeParser</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 DateTimeParser</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> DateTime<br />
<b>Header:</b> Poco/DateTimeParser.h</p>
<h2>Description</h2>
<div class="description">
<p>This class provides a method for parsing dates and times from strings. All parsing methods do their best to parse a meaningful result, even from malformed input strings. </p>
<p>The returned <a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> will always contain a time in the same timezone as the time in the string. Call <a href="Poco.DateTime.html#4435" title="Poco::DateTime::makeUTC()">DateTime::makeUTC</a>() with the timeZoneDifferential returned by <a href="Poco.DateTimeParser.html#4543" title="Poco::DateTimeParser::parse()">parse</a>() to convert the <a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> to UTC. </p>
<p>Note: When parsing a time in 12-hour (AM/PM) format, the hour (%h) must be parsed before the AM/PM designator (%a, %A), otherwise the AM/PM designator will be ignored. </p>
<p>See the <a href="Poco.DateTimeFormatter.html" title="class Poco::DateTimeFormatter">DateTimeFormatter</a> class for a list of supported format specifiers. In addition to the format specifiers supported by <a href="Poco.DateTimeFormatter.html" title="class Poco::DateTimeFormatter">DateTimeFormatter</a>, an additional specifier is supported: %r will parse a year given by either two or four digits. Years 69-00 are interpreted in the 20th century (1969-2000), years 01-68 in the 21th century (2001-2068). </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.DateTimeParser.html#4543" title="Poco::DateTimeParser::parse()">parse</a>, <a href="Poco.DateTimeParser.html#4577" title="Poco::DateTimeParser::parseAMPM()">parseAMPM</a>, <a href="Poco.DateTimeParser.html#4571" title="Poco::DateTimeParser::parseDayOfWeek()">parseDayOfWeek</a>, <a href="Poco.DateTimeParser.html#4568" title="Poco::DateTimeParser::parseMonth()">parseMonth</a>, <a href="Poco.DateTimeParser.html#4574" title="Poco::DateTimeParser::parseTZD()">parseTZD</a>, <a href="Poco.DateTimeParser.html#4552" title="Poco::DateTimeParser::tryParse()">tryParse</a></p>
<h2>Member Functions</h2>
<h3><a name="4543">parse</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void parse(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;int &amp; timeZoneDifferential<br />);</p>
<div class="description">
<p>Parses a date and time in the given format from the given string. Throws a <a href="Poco.SyntaxException.html" title="class Poco::SyntaxException">SyntaxException</a> if the string cannot be successfully parsed. Please see <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">DateTimeFormatter::format</a>() for a description of the format string. 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="4548">parse</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> parse(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;int &amp; timeZoneDifferential<br />);</p>
<div class="description">
<p>Parses a date and time in the given format from the given string. Throws a <a href="Poco.SyntaxException.html" title="class Poco::SyntaxException">SyntaxException</a> if the string cannot be successfully parsed. Please see <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">DateTimeFormatter::format</a>() for a description of the format string. 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="4557">parse</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static void parse(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;int &amp; timeZoneDifferential<br />);</p>
<div class="description">
<p>Parses a date and time from the given dateTime string. Before parsing, the method examines the dateTime string for a known date/time format. Throws a <a href="Poco.SyntaxException.html" title="class Poco::SyntaxException">SyntaxException</a> if the string cannot be successfully parsed. Please see <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">DateTimeFormatter::format</a>() for a description of the format string. 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="4561">parse</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> parse(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;int &amp; timeZoneDifferential<br />);</p>
<div class="description">
<p>Parses a date and time from the given dateTime string. Before parsing, the method examines the dateTime string for a known date/time format. Please see <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">DateTimeFormatter::format</a>() for a description of the format string. 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="4571">parseDayOfWeek</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int parseDayOfWeek(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string::const_iterator &amp; it,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string::const_iterator &amp; end<br />);</p>
<div class="description">
<p>Tries to interpret the given range as a weekday name. The range must be at least three characters long.  Returns the weekday number (0 .. 6, where 0 = Synday, 1 = Monday, etc.) if the  weekday name is valid. Otherwise throws a <a href="Poco.SyntaxException.html" title="class Poco::SyntaxException">SyntaxException</a>. </p>
</div>
<h3><a name="4568">parseMonth</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int parseMonth(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string::const_iterator &amp; it,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string::const_iterator &amp; end<br />);</p>
<div class="description">
<p>Tries to interpret the given range as a month name. The range must be at least three characters long.  Returns the month number (1 .. 12) if the month name is valid. Otherwise throws a <a href="Poco.SyntaxException.html" title="class Poco::SyntaxException">SyntaxException</a>. </p>
</div>
<h3><a name="4552">tryParse</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool tryParse(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; fmt,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;int &amp; timeZoneDifferential<br />);</p>
<div class="description">
<p>Parses a date and time in the given format from the given string. Returns true if the string has been successfully parsed, false otherwise. Please see <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">DateTimeFormatter::format</a>() for a description of the format string. 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="4564">tryParse</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static bool tryParse(<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; str,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.DateTime.html" title="class Poco::DateTime">DateTime</a> &amp; dateTime,<br />&nbsp;&nbsp;&nbsp;&nbsp;int &amp; timeZoneDifferential<br />);</p>
<div class="description">
<p>Parses a date and time from the given dateTime string. Before parsing, the method examines the dateTime string for a known date/time format. Please see <a href="Poco.DateTimeFormatter.html#4500" title="Poco::DateTimeFormatter::format()">DateTimeFormatter::format</a>() for a description of the format string. 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="4577">parseAMPM</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int parseAMPM(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string::const_iterator &amp; it,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string::const_iterator &amp; end,<br />&nbsp;&nbsp;&nbsp;&nbsp;int hour<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="4574">parseTZD</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" />  <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static int parseTZD(<br />&nbsp;&nbsp;&nbsp;&nbsp;std::string::const_iterator &amp; it,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string::const_iterator &amp; end<br />);</p>
<div class="description">
<p></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>