: Why does DateTools.dateToString() return a String representation of my Date,
: but in a different TimeZone. Does it use its own Calendar/TimeZone settings?

Yes, DateTime is hardcoded to use GMT for it's string representations.

It wouldn't be safe for DateTools to use your current TimeZone/Locale,
because once you've indexed the value, your index might be used by another
application (or another instance of your application) running in a
differnet locale.

The important thing is not what string DateTools.dateToString returns,
it's whether you get an equivilent date back (based on the resolution you
specified)) when you do something like this...

  Date a = ...;
  DateTools.Resolution r = ...;
  Date b = DateTools.stringToDate(DateTools.dateToString(a,r));
  System.out.println("Is '"+a+"' the same as '"+b+"' with "+r+" resolution?");


-Hoss


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

Reply via email to