Hello, could you please use the project prefix "[lang]" in the subject of such emails? It makes it easier to sort through and filter this list. Thanks, Gary
> -----Original Message----- > From: Serge Knystautas [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 17, 2004 12:16 > To: Jakarta Commons Developers List > Subject: Re: DateUtils.equals(d1, d2) > > Serge Knystautas wrote: > > Todd V. Jonker wrote: > >> I like your idea of calling getTime() and rounding to the second. That > >> should work in all cases. > > > > Not exactly that... more like this: > > > > long ms1 = d1.getTime(); > > if (d1 instanceof Timestamp) { > > //First we remove milliseconds > > // that some Timestamp implementations include > > ms1 /= 1000; > > ms1 *= 1000; > > //Now add milliseconds based on nano seconds that all impls have. > > ms1 += ((Timestamp) d1).getNanos() / 1000; > > } > > Actually, why not also add DateUtils.getMilliseconds(Date d) so people > stuck with bad drivers can effectively get reliable getTime() behavior? > > -- > Serge Knystautas > President > Lokitech >> software . strategy . design >> http://www.lokitech.com > p. 301.656.5501 > e. [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]
