DITTO !!!

I like date truncation, but when I store a truncated date, I don't want to
retrieve the time in Greenwich, England at midnight of the date I'm
truncating in the local machine's time zone.  Nothing against the Brits, it
just doesn't do me any good to know what time it was over there on the day
in question.  What I want back is midnight of the correct day in the time
zone of the local machine.  In other words, when I specify DAY resolution,
I'm saying TIME-ZONE IS IRRELEVENT, ALWAYS GIVE ME THE CORRECT DATE IN THE
LOCAL TIME ZONE.

Understanding the need for backwards-compatibility, I vote that there ought
to be some kind of parameter I can set when converting Date-To-String and
String-To-Date to force TRUNCATION of a date (as in Oracle, for example) so
that it will return the correct date in local time when retrieved.

Without the ability to force symmetrical storage-retrieval, I think any
DateTools Resolutions to time units greater than hours has no practical
value and only serves to mislead people.

-----Original Message-----
From: Michael J. Prichard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 18, 2006 2:39 PM
To: java-user@lucene.apache.org
Subject: Re: DateTools oddity....

Dang it :)

Anyway to set timezone?

Emmanuel Bernard wrote:

> DateTools use GMT as a timezone
>    Tue Aug 01 21:15:45 EDT 2006
>    Wed Aug 02 02:15:45 EDT 2006
>
> Michael J. Prichard wrote:
>
>>
>> When I run this java code:
>>
>>     Long dates = new Long("1154481345000");
>>     Date dada = new Date(dates.longValue());
>>     System.out.println(dada.toString());
>>     System.out.println(DateTools.dateToString(dada,
>> DateTools.Resolution.DAY));
>>
>> I get this output:
>>
>>     Tue Aug 01 21:15:45 EDT 2006
>>     20060802
>>
>> Huh?!  Should it be:
>>     20060801
>>
>> ??
>>
>> Any ideas?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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




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

Reply via email to