I have a question about DateTools conversions.  I am having trouble with
results of trying to store a date truncated to DAY resolution. 

Here is an example.

----------------------------------------------------------------------------
----

OK:

DateTools.stringToDate(DateTools.dateToString(new Date("01/12/2006"),
DateTools.Resolution.SECOND))
         (java.util.Date) Thu Jan 12 00:00:00 CST 2006

NOT OK:

DateTools.stringToDate(DateTools.dateToString(new Date("01/12/2006"),
DateTools.Resolution.DAY))
         (java.util.Date) Wed Jan 11 18:00:00 CST 2006

----------------------------------------------------------------------------
----

The problem appears to be on the stringToDate conversion.

----------------------------------------------------------------------------
----

OK:

DateTools.dateToString(new Date("01/12/2006"), DateTools.Resolution.DAY)
         (java.lang.String) 20060112

NOT OK:

DateTools.stringToDate("20060112")
         (java.util.Date) Wed Jan 11 18:00:00 CST 2006

----------------------------------------------------------------------------
----

I assume there is something simple I am missing, please, anybody, WHAT?

Local time zone is GMT-0600 (CST)

OS is Redhat E-L 4.

jre is from Sun jdk 1.4

Lucene is lucene-core-2.0.1.jar

Paul Snyder
Web Programmer
Post-Bulletin Company, L.L.C.
Phone (507) 281-7402 Fax (507) 281-7491 TollFree (800) 562-1758 
http://www.postbulletin.com http://www.pbinternetservices.com
http://www.rochestermn.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to