<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mailutils.org/usqay/index.php?action=history&amp;feed=atom&amp;title=Mu_scan_datetime</id>
	<title>Mu scan datetime - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mailutils.org/usqay/index.php?action=history&amp;feed=atom&amp;title=Mu_scan_datetime"/>
	<link rel="alternate" type="text/html" href="https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;action=history"/>
	<updated>2026-10-18T04:05:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=496&amp;oldid=prev</id>
		<title>Gray: Document changes in endp semantics.</title>
		<link rel="alternate" type="text/html" href="https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=496&amp;oldid=prev"/>
		<updated>2020-11-27T11:33:16Z</updated>

		<summary type="html">&lt;p&gt;Document changes in endp semantics.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:33, 27 November 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot; &gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The function &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; scans the string &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt;, which is supposed to contain a date/time information, according to the &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; and places the resulting broken-down time in the &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; variable. Unless &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; the time zone information is stored there&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;.  Unless &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; stores the address of the character where scanning stopped in &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt;&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The function &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; scans the string &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt;, which is supposed to contain a date/time information, according to the &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; and places the resulting broken-down time in the &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; variable. Unless &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; the time zone information is stored there.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The &lt;/del&gt;function returns 0 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;on success&lt;/del&gt;, &amp;lt;tt&amp;gt;MU_ERR_PARSE&amp;lt;/tt&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;if &lt;/del&gt;&amp;lt;tt&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;input&lt;/del&gt;&amp;lt;/tt&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;does not satisfy &lt;/del&gt;&amp;lt;tt&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;format&lt;/del&gt;&amp;lt;/tt&amp;gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and &lt;/del&gt;&amp;lt;tt&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;MU_ERR_FORMAT&lt;/del&gt;&amp;lt;/tt&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;if &lt;/del&gt;&amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; itself is erroneous.  &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;In &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;latter case&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;a detailed &lt;/del&gt;information about the error is output to the [[Debug level|debugging channel]] &amp;lt;tt&amp;gt;mailbox.error&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;On success, the &lt;/ins&gt;function returns 0&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.  If the input does not satisfy the format&lt;/ins&gt;, &amp;lt;tt&amp;gt;MU_ERR_PARSE&amp;lt;/tt&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is returned.  In both cases, unless &lt;/ins&gt;&amp;lt;tt&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;endp&lt;/ins&gt;&amp;lt;/tt&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/ins&gt;&amp;lt;tt&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;NULL&lt;/ins&gt;&amp;lt;/tt&amp;gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;it will be initialized with the address of the character in &lt;/ins&gt;&amp;lt;tt&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;input&lt;/ins&gt;&amp;lt;/tt&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;where the scanning stopped.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;If &lt;/ins&gt;&amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; itself is erroneous&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, &amp;lt;tt&amp;gt;MU_ERR_FORMAT&amp;lt;/tt&amp;gt; is returned&lt;/ins&gt;.  &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The address of the character '''in fmt''' at which the error was detected will be stored in &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;memory location pointed to by &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt;&lt;/ins&gt;,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;unless it is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;&amp;lt;ref&amp;gt;This change was introduced by commit [http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=df29254df82d4aa466f066dd76e00446e540e1cb df29254df8].  Prior to this, &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt; always received the address of the character in &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; where the conversion stopped.&amp;lt;/ref&amp;gt;.  Detailed &lt;/ins&gt;information about the error is output to the [[Debug level|debugging channel]] &amp;lt;tt&amp;gt;mailbox.error&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; follows the [[mu_c_streamftime#Format_string|mu_c_streamftime format specification]] with several extensions.  It is interpreted as follows:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; follows the [[mu_c_streamftime#Format_string|mu_c_streamftime format specification]] with several extensions.  It is interpreted as follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gray</name></author>
	</entry>
	<entry>
		<id>https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=387&amp;oldid=prev</id>
		<title>Gray at 18:52, 7 July 2014</title>
		<link rel="alternate" type="text/html" href="https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=387&amp;oldid=prev"/>
		<updated>2014-07-07T18:52:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:52, 7 July 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l15&quot; &gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A sequence of white-space characters (space, tab, newline, etc.; see [[mu_isspace]]) matches any amount of white space, including none, in the input.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A sequence of white-space characters (space, tab, newline, etc.; see [[mu_isspace]]) matches any amount of white space, including none, in the input.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* An ordinary character (i.e., one other than white space or &amp;lt;tt&amp;gt;%&amp;lt;/tt&amp;gt;) must exactly match the next character of input.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* An ordinary character (i.e., one other than white space or &amp;lt;tt&amp;gt;%&amp;lt;/tt&amp;gt;) must exactly match the next character of input.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A [[mu_c_streamftime#Format_string|conversion specifier]] parses next characters according to its definition and stores the result in the corresponding location in &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; (unless the latter is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A [[mu_c_streamftime#Format_string|conversion specifier]] parses next characters according to its definition and stores the result in the corresponding location in &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; (unless the latter is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A '''flow control''' conversion alters the way the format is interpreted.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A '''flow control''' conversion alters the way the format is interpreted.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gray</name></author>
	</entry>
	<entry>
		<id>https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=304&amp;oldid=prev</id>
		<title>Gray at 11:59, 17 December 2011</title>
		<link rel="alternate" type="text/html" href="https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=304&amp;oldid=prev"/>
		<updated>2011-12-17T11:59:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:59, 17 December 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot; &gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The function &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;parses &lt;/del&gt;the string &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt;, which is supposed to contain a date/time information, according to the &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; and places the resulting broken-down time in the &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; variable. Unless &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; the time zone information is stored there.  Unless &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; stores the address of the character where &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;parsing &lt;/del&gt;stopped in &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The function &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;scans &lt;/ins&gt;the string &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt;, which is supposed to contain a date/time information, according to the &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; and places the resulting broken-down time in the &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; variable. Unless &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; the time zone information is stored there.  Unless &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; stores the address of the character where &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;scanning &lt;/ins&gt;stopped in &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The function returns 0 on success, &amp;lt;tt&amp;gt;MU_ERR_PARSE&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; does not satisfy &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;MU_ERR_FORMAT&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; itself is erroneous.  In the latter case, a detailed information about the error is output to the [[Debug level|debugging channel]] &amp;lt;tt&amp;gt;mailbox.error&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The function returns 0 on success, &amp;lt;tt&amp;gt;MU_ERR_PARSE&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; does not satisfy &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;MU_ERR_FORMAT&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; itself is erroneous.  In the latter case, a detailed information about the error is output to the [[Debug level|debugging channel]] &amp;lt;tt&amp;gt;mailbox.error&amp;lt;/tt&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gray</name></author>
	</entry>
	<entry>
		<id>https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=303&amp;oldid=prev</id>
		<title>Gray: Created page with &quot;{{DISPLAYTITLE:mu_scan_datetime}} &lt;syntaxhighlight lang=&quot;C&quot;&gt; #include &lt;mailutils/datetime.h&gt;  int mu_scan_datetime (const char *input, const char *format, struct tm *tm,         ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mailutils.org/usqay/index.php?title=Mu_scan_datetime&amp;diff=303&amp;oldid=prev"/>
		<updated>2011-12-17T11:58:24Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{DISPLAYTITLE:mu_scan_datetime}} &amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt; #include &amp;lt;mailutils/datetime.h&amp;gt;  int mu_scan_datetime (const char *input, const char *format, struct tm *tm,         ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:mu_scan_datetime}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;mailutils/datetime.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int mu_scan_datetime (const char *input, const char *format, struct tm *tm,&lt;br /&gt;
                      struct mu_timezone *tz, char **endp);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; parses the string &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt;, which is supposed to contain a date/time information, according to the &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; and places the resulting broken-down time in the &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; variable. Unless &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; the time zone information is stored there.  Unless &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;mu_scan_datetime&amp;lt;/tt&amp;gt; stores the address of the character where parsing stopped in &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The function returns 0 on success, &amp;lt;tt&amp;gt;MU_ERR_PARSE&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; does not satisfy &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;MU_ERR_FORMAT&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; itself is erroneous.  In the latter case, a detailed information about the error is output to the [[Debug level|debugging channel]] &amp;lt;tt&amp;gt;mailbox.error&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;format&amp;lt;/tt&amp;gt; follows the [[mu_c_streamftime#Format_string|mu_c_streamftime format specification]] with several extensions.  It is interpreted as follows:&lt;br /&gt;
&lt;br /&gt;
* A sequence of white-space characters (space, tab, newline, etc.; see [[mu_isspace]]) matches any amount of white space, including none, in the input.&lt;br /&gt;
* An ordinary character (i.e., one other than white space or &amp;lt;tt&amp;gt;%&amp;lt;/tt&amp;gt;) must exactly match the next character of input.&lt;br /&gt;
* A [[mu_c_streamftime#Format_string|conversion specifier]] parses next characters according to its definition and stores the result in the corresponding location in &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; (unless the latter is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* A '''flow control''' conversion alters the way the format is interpreted.&lt;br /&gt;
&lt;br /&gt;
Flow control specifiers are:&lt;br /&gt;
&lt;br /&gt;
;%?&lt;br /&gt;
:This specifier matches any single character on input.&lt;br /&gt;
&lt;br /&gt;
;%\'''C'''&lt;br /&gt;
:(where '''C''' is any single character) This specifier matches character '''C''' exactly.  It is useful for specifying mandatory whitespace, as in:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;%d-%b-%Y%\ %H:%M:%S %z&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The above format requires date and time parts to be separated by a single space character.&lt;br /&gt;
&lt;br /&gt;
;%$&lt;br /&gt;
:This specifier means optional end of input.  That is, if the input does not match conversion past this specifier, it is not considered an error.  Instead, the &amp;lt;tt&amp;gt;endp&amp;lt;/tt&amp;gt; is set to the position where scanning stopped and 0 is returned.  The &amp;lt;tt&amp;gt;tm&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tz&amp;lt;/tt&amp;gt; variables are left with the partial information collected so far.&lt;br /&gt;
&lt;br /&gt;
Consider, for example, date format used in IMAP SEARCH command.  It is basically described as follows:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;%d-%b-%Y %H:%M:%S %z&amp;quot;&lt;br /&gt;
&lt;br /&gt;
However, the time and timezone information is optional.  To allow for that, the following format can be used instead:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;%d-%b-%Y%$ %H:%M:%S %z&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(see the &amp;lt;tt&amp;gt;MU_DATETIME_INTERNALDATE&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;mailutils/datetime.h&amp;lt;/tt&amp;gt;&amp;lt;ref&amp;gt;http://git.gnu.org.ua/cgit/mailutils.git/tree/include/mailutils/datetime.h&amp;lt;/ref&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
;%[ %| %]&lt;br /&gt;
:The part of format enclosed between &amp;lt;tt&amp;gt;%[&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;%]&amp;lt;/tt&amp;gt; specifiers is optional.  The specifiers can be nested to any depth.  The &amp;lt;tt&amp;gt;%|&amp;lt;/tt&amp;gt; specifier appearing within the optional group introduces an '''optional alternative'''.  Any number of alternatives may be present.&lt;br /&gt;
&lt;br /&gt;
Let's return to the above format for an example.  It can be rewritten using optional group as follows:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;%d-%b-%Y%[ %H:%M:%S %z%]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
As a more complex example, consider RFC-822 date format.  It has two optional parts: the day of week at the beginning and seconds at the end.  The corresponding scan format is:&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;%[%a, %]%e %b %Y %H:%M%[:%S%] %z&amp;quot;&lt;br /&gt;
&lt;br /&gt;
See the &amp;lt;tt&amp;gt;MU_DATETIME_SCAN_RFC822&amp;lt;/tt&amp;gt; define in &amp;lt;tt&amp;gt;mailutils/datetime.h&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The following example illustrates nested optional groups:&lt;br /&gt;
&lt;br /&gt;
  %[%a%[,%] %]%d %b %Y %H:%M:%S %z&lt;br /&gt;
&lt;br /&gt;
It matches any of the following date specifications:&lt;br /&gt;
&lt;br /&gt;
  Tue, 03 May 2011 13:25:26 +0200&lt;br /&gt;
  Tue 03 May 2011 13:25:26 +0200&lt;br /&gt;
  03 May 2011 13:25:26 +0200&lt;br /&gt;
&lt;br /&gt;
;%( %| %)&lt;br /&gt;
:Alternatives.  This specifier requires that the input matches one of the alternatives separated by &amp;lt;tt&amp;gt;%|&amp;lt;/tt&amp;gt;.  Two or more alternatives may be specified, but at least two must be present.  &lt;br /&gt;
&lt;br /&gt;
For example the following format&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;%a%(,%|:%|/%) %d %b %Y %H:%M:%S %z&amp;quot;&lt;br /&gt;
&lt;br /&gt;
requires the day of time (&amp;lt;tt&amp;gt;%a&amp;lt;/tt&amp;gt;) to be followed by a single comma, semicolon or slash.  Any other character following it will cause the format to fail.&lt;br /&gt;
&lt;br /&gt;
Optional blocks and alternative specifiers can be nested.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
[[mu_c_streamftime]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Date/Time Functions]]&lt;br /&gt;
[[Category:C API]]&lt;/div&gt;</summary>
		<author><name>Gray</name></author>
	</entry>
</feed>