<div class="gmail_quote">On Thu, Dec 11, 2008 at 10:59 AM, Paul Koning <span dir="ltr">&lt;<a href="mailto:Paul_Koning@dell.com">Paul_Koning@dell.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
&gt;&gt;&gt;&gt;&gt; &quot;Jennifer&quot; == Jennifer Wang &lt;(jennifwa)&quot; &lt;<a href="mailto:jennifwa@cisco.com">jennifwa@cisco.com</a>&gt;&gt; writes:<br>
<br>
&nbsp;Jennifer&gt; I think in most case when a caller sets the time to 2:10am<br>
&nbsp;Jennifer&gt; Mar 8, 2009 in America/Los_Angeles, he does not realize<br>
&nbsp;Jennifer&gt; it&#39;s the &quot;missing hour&quot;. &nbsp;If he wants 1:10am (which is a<br>
&nbsp;Jennifer&gt; valid time), he would use that. &nbsp;So moving forward to<br>
&nbsp;Jennifer&gt; 3:10am seems to make sense.<br>
<br>
No, it doesn&#39;t. &nbsp;If he meant 3:10 he would have said so. &nbsp;There is no<br>
basis at all to guess at the user&#39;s intent in this way.<br>
<br>
It&#39;s very simple. &nbsp;The user is asking for a non-existent time. &nbsp;So the<br>
reject is valid. &nbsp;It is every bit as valid as an attempt to set the<br>
current date/time to February 30th.</blockquote><div><br></div><div>That&#39;s actually a poorly chosen example, since mktime() does guess the users intent in a case like that, by normalizing fields that are out of range. &nbsp; February 30th would be normalized to March 1st or March 2nd (depending on the year).</div>
<div><br></div><div>However, I still contend that these cases are different. &nbsp;In the case of a field that goes beyond its normal range, you can clearly and unambiguously determine the user&#39;s intent, since mktime() was designed to make it easy to do something like calculate a date that is, say, 14 days in the future or past by simply adding or subtracting fourteen days on the tm_mday field. &nbsp; Then mktime() takes the denormalized representation and does the right thing.</div>
<div><br></div><div>In the case of the non-existent hour during a DST transition, there is an inherent ambiguity, since you don&#39;t know if the caller added to or subtracted from the tm_hour field to get to the invalid time.</div>
<div><br></div><div>-Scott</div></div><br>-- <br>Scott Atwood<br><br>Cycle tracks will abound in Utopia. &nbsp;~H.G. Wells<br><br><br>