<div class="gmail_quote">On Thu, Dec 11, 2008 at 10:59 AM, Paul Koning <span dir="ltr"><<a href="mailto:Paul_Koning@dell.com">Paul_Koning@dell.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
>>>>> "Jennifer" == Jennifer Wang <(jennifwa)" <<a href="mailto:jennifwa@cisco.com">jennifwa@cisco.com</a>>> writes:<br>
<br>
 Jennifer> I think in most case when a caller sets the time to 2:10am<br>
 Jennifer> Mar 8, 2009 in America/Los_Angeles, he does not realize<br>
 Jennifer> it's the "missing hour".  If he wants 1:10am (which is a<br>
 Jennifer> valid time), he would use that.  So moving forward to<br>
 Jennifer> 3:10am seems to make sense.<br>
<br>
No, it doesn't.  If he meant 3:10 he would have said so.  There is no<br>
basis at all to guess at the user's intent in this way.<br>
<br>
It's very simple.  The user is asking for a non-existent time.  So the<br>
reject is valid.  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'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.   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.  In the case of a field that goes beyond its normal range, you can clearly and unambiguously determine the user'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.   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'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.  ~H.G. Wells<br><br><br>