<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>27020</bug_id>
          
          <creation_ts>2009-07-06 20:03:13 -0700</creation_ts>
          <short_desc>msToGregorianDateTime ignores outputIsUTC param when filling in utcOffset</short_desc>
          <delta_ts>2009-07-15 09:59:00 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Template Framework</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>23154</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Joe Mason">joenotcharles</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eric</cc>
    
    <cc>manyoso</cc>
    
    <cc>yong.li.webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>130113</commentid>
    <comment_count>0</comment_count>
    <who name="Joe Mason">joenotcharles</who>
    <bug_when>2009-07-06 20:03:13 -0700</bug_when>
    <thetext>msToGregorianDateTime has an outputIsUTC parameter - if false, the output should be in localtime.

If the parameter is true, the result GregorianDateTime structure is filled with a time in UTC, but the utcOffset field is still set to the local timezone offset as if it were filled with a local time.  I believe it should always be 0 if outputIsUTC is true.

This happens to work in most cases because utcOffset is never used - it happens that everywhere msToGregorianDateTime is called with outputIsUTC true, it&apos;s in a code path which doesn&apos;t look at utcOffset.  I don&apos;t think we should be depending on this, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>130126</commentid>
    <comment_count>1</comment_count>
      <attachid>32358</attachid>
    <who name="Joe Mason">joenotcharles</who>
    <bug_when>2009-07-06 20:58:38 -0700</bug_when>
    <thetext>Created attachment 32358
patch to DateMath.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>130137</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-07-07 00:06:20 -0700</bug_when>
    <thetext>So this code path is never used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>130207</commentid>
    <comment_count>3</comment_count>
    <who name="Joe Mason">joenotcharles</who>
    <bug_when>2009-07-07 08:03:03 -0700</bug_when>
    <thetext>The most common idiom boils down to:

  msToGregorianDateTime(millisecs, outputIsUTC, t);
  if (outputIsUTC)
    // do something with t.month, t.year, etc. but not t.utcOffset
  else
    // do something with t.month, t.year, etc. adjusting for t.utcOffset
  
So the code path in this patch is followed, but in the case where utcOffset is wrong it isn&apos;t used anyway.  I believe all calls to msToGregorianDateTime work like this, but some of them are pretty complex so I can&apos;t be 100% sure.

We have this patch in our WinCE branch because at one point Google Calendar didn&apos;t work for us without it.  I thought that it worked now, but I was submitting it anyway because it seemed like the correct thing to do (and I figured if not we would find that out during the code review.)

However, Yong thinks Google Calendar still doesn&apos;t work for us without this patch.  I&apos;m trying to find a test case now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131558</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Treat">manyoso</who>
    <bug_when>2009-07-14 07:53:25 -0700</bug_when>
    <thetext>Joe, can you update this bug with latest info you have about the testcase?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131675</commentid>
    <comment_count>5</comment_count>
    <who name="Joe Mason">joenotcharles</who>
    <bug_when>2009-07-14 14:32:46 -0700</bug_when>
    <thetext>I haven&apos;t been able to find any broken behaviour that this patch fixes.

However, I also haven&apos;t been able to find anything that it breaks, so I think it should go in because it makes the code more resistant to future breakage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131888</commentid>
    <comment_count>6</comment_count>
      <attachid>32358</attachid>
    <who name="George Staikos">staikos</who>
    <bug_when>2009-07-15 08:11:36 -0700</bug_when>
    <thetext>Comment on attachment 32358
patch to DateMath.cpp

absence of comments otherwise and it looks both correct and reasonable to me, so r+</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131929</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Treat">manyoso</who>
    <bug_when>2009-07-15 09:59:00 -0700</bug_when>
    <thetext>Landed with r45918.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>32358</attachid>
            <date>2009-07-06 20:58:38 -0700</date>
            <delta_ts>2009-07-15 08:11:36 -0700</delta_ts>
            <desc>patch to DateMath.cpp</desc>
            <filename>bug27020.patch</filename>
            <type>text/plain</type>
            <size>1444</size>
            <attacher name="Joe Mason">joenotcharles</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCAzMzg5MjgxLi40MTMyMGVjIDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTMg
QEAKKzIwMDktMDctMDYgIFlvbmcgTGkgIDx5b25nLmxpQHRvcmNobW9iaWxlLmNvbT4KKworICAg
ICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MjcwMjAKKyAgICAgICAgbXNUb0dyZWdvcmlhbkRh
dGVUaW1lIHNob3VsZCBzZXQgdXRjT2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ZWdvcmlhbkRhdGVUaW1lJiB0bSkKICAgICB0bS55ZWFyICAg
ICA9ICB5ZWFyIC0gMTkwMDsKICAgICB0bS5pc0RTVCAgICA9ICBkc3RPZmYgIT0gMC4wOwogCi0g
ICAgdG0udXRjT2Zmc2V0ID0gc3RhdGljX2Nhc3Q8bG9uZz4oKGRzdE9mZiArIHV0Y09mZikgLyBt
c1BlclNlY29uZCk7CisgICAgdG0udXRjT2Zmc2V0ID0gb3V0cHV0SXNVVEMgPyAwIDogc3RhdGlj
X2Nhc3Q8bG9uZz4oKGRzdE9mZiArIHV0Y09mZikgLyBtc1BlclNlY29uZCk7CiAgICAgdG0udGlt
ZVpvbmUgPSBOVUxMOwogfQogCg==
</data>
<flag name="review"
          id="16814"
          type_id="1"
          status="+"
          setter="staikos"
    />
          </attachment>
      

    </bug>

</bugzilla>