[jira] Created: (LUCENE-491) DateTools needs to use UTC for correct collation,

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LUCENE-491) DateTools needs to use UTC for correct collation,

JIRA jira@apache.org
DateTools needs to use UTC for correct collation,
-------------------------------------------------

         Key: LUCENE-491
         URL: http://issues.apache.org/jira/browse/LUCENE-491
     Project: Lucene - Java
        Type: Bug
    Versions: CVS Nightly - Specify date in submission    
 Environment: svn trunk at 02-Feb-2005, noon GMT.  OS independent.
    Reporter: John Haxby


If your local timezone is Europe/London then the times Sun, 30 Oct 2005 00:00:00 +0000 and exactly one hour later are both converted to 200530010000 by DateTools.dateToString() with minute resolution.   The Linux date command is useful in seeing why:

    $ date --date "Sun, 30 Oct 2005 00:00:00 +0000"
    Sun Oct 30 01:00:00 BST 2005

    $ date --date "Sun, 30 Oct 2005 01:00:00 +0000"
    Sun Oct 30 01:00:00 GMT 2005

Both times are 1am in the morning, but one is when DST is in force, the other isn't.   Of course, these are actually different times!

Of course, if dates are stored in the index with implicit timezone information then not only do we get problems when the clocks go back at the end of summer, but we also have problems crossing timezones.   If a database is created in California and used in Paris then the times are going to be badly skewed (there's a nine hour time difference most of the year).


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-491) DateTools needs to use UTC for correct collation,

JIRA jira@apache.org
     [ http://issues.apache.org/jira/browse/LUCENE-491?page=all ]

John Haxby updated LUCENE-491:
------------------------------

    Attachment: testcase.java

TestCase for problem.

> DateTools needs to use UTC for correct collation,
> -------------------------------------------------
>
>          Key: LUCENE-491
>          URL: http://issues.apache.org/jira/browse/LUCENE-491
>      Project: Lucene - Java
>         Type: Bug
>     Versions: CVS Nightly - Specify date in submission
>  Environment: svn trunk at 02-Feb-2005, noon GMT.  OS independent.
>     Reporter: John Haxby
>  Attachments: testcase.java
>
> If your local timezone is Europe/London then the times Sun, 30 Oct 2005 00:00:00 +0000 and exactly one hour later are both converted to 200530010000 by DateTools.dateToString() with minute resolution.   The Linux date command is useful in seeing why:
>     $ date --date "Sun, 30 Oct 2005 00:00:00 +0000"
>     Sun Oct 30 01:00:00 BST 2005
>     $ date --date "Sun, 30 Oct 2005 01:00:00 +0000"
>     Sun Oct 30 01:00:00 GMT 2005
> Both times are 1am in the morning, but one is when DST is in force, the other isn't.   Of course, these are actually different times!
> Of course, if dates are stored in the index with implicit timezone information then not only do we get problems when the clocks go back at the end of summer, but we also have problems crossing timezones.   If a database is created in California and used in Paris then the times are going to be badly skewed (there's a nine hour time difference most of the year).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-491) DateTools needs to use UTC for correct collation,

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
     [ http://issues.apache.org/jira/browse/LUCENE-491?page=all ]

John Haxby updated LUCENE-491:
------------------------------

    Attachment: patch

Patch for problem.   Basically, whereever a timezone can be used, we use GMT.

> DateTools needs to use UTC for correct collation,
> -------------------------------------------------
>
>          Key: LUCENE-491
>          URL: http://issues.apache.org/jira/browse/LUCENE-491
>      Project: Lucene - Java
>         Type: Bug
>     Versions: CVS Nightly - Specify date in submission
>  Environment: svn trunk at 02-Feb-2005, noon GMT.  OS independent.
>     Reporter: John Haxby
>  Attachments: patch, testcase.java
>
> If your local timezone is Europe/London then the times Sun, 30 Oct 2005 00:00:00 +0000 and exactly one hour later are both converted to 200530010000 by DateTools.dateToString() with minute resolution.   The Linux date command is useful in seeing why:
>     $ date --date "Sun, 30 Oct 2005 00:00:00 +0000"
>     Sun Oct 30 01:00:00 BST 2005
>     $ date --date "Sun, 30 Oct 2005 01:00:00 +0000"
>     Sun Oct 30 01:00:00 GMT 2005
> Both times are 1am in the morning, but one is when DST is in force, the other isn't.   Of course, these are actually different times!
> Of course, if dates are stored in the index with implicit timezone information then not only do we get problems when the clocks go back at the end of summer, but we also have problems crossing timezones.   If a database is created in California and used in Paris then the times are going to be badly skewed (there's a nine hour time difference most of the year).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (LUCENE-491) DateTools needs to use UTC for correct collation,

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org
     [ http://issues.apache.org/jira/browse/LUCENE-491?page=all ]
     
Daniel Naber closed LUCENE-491:
-------------------------------

    Fix Version: 1.9
     Resolution: Fixed

Thanks, I have committed your patch. I needed to make other changes to the old test cases to keep them working. Maybe you can re-check to make sure everything is okay now.

> DateTools needs to use UTC for correct collation,
> -------------------------------------------------
>
>          Key: LUCENE-491
>          URL: http://issues.apache.org/jira/browse/LUCENE-491
>      Project: Lucene - Java
>         Type: Bug
>     Versions: CVS Nightly - Specify date in submission
>  Environment: svn trunk at 02-Feb-2005, noon GMT.  OS independent.
>     Reporter: John Haxby
>      Fix For: 1.9
>  Attachments: patch, testcase.java
>
> If your local timezone is Europe/London then the times Sun, 30 Oct 2005 00:00:00 +0000 and exactly one hour later are both converted to 200530010000 by DateTools.dateToString() with minute resolution.   The Linux date command is useful in seeing why:
>     $ date --date "Sun, 30 Oct 2005 00:00:00 +0000"
>     Sun Oct 30 01:00:00 BST 2005
>     $ date --date "Sun, 30 Oct 2005 01:00:00 +0000"
>     Sun Oct 30 01:00:00 GMT 2005
> Both times are 1am in the morning, but one is when DST is in force, the other isn't.   Of course, these are actually different times!
> Of course, if dates are stored in the index with implicit timezone information then not only do we get problems when the clocks go back at the end of summer, but we also have problems crossing timezones.   If a database is created in California and used in Paris then the times are going to be badly skewed (there's a nine hour time difference most of the year).

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]