Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: How can I use Operand (+ , - ) with Time Date: Sun, 15 Jan 2012 15:39:09 -0800 Organization: albasani.net Lines: 19 Message-ID: References: <34afdd1f-4549-48a9-878c-8678993e97ed@t30g2000vbx.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net MOgA5u6TPpCrUVio4j8McbSysw7neh2qRbz6GuSxXYUfSTwOdaCu5Z0JKZM+EoG/2j2US/ixN+z80TKa0BUzEO5PADWJzRK8TYMeKOUpT5SVxmQ4Mc7i1N2utqyi5RMz NNTP-Posting-Date: Sun, 15 Jan 2012 23:39:09 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="5SveBWGn3J/krL7iU4nmeOdFzHfOeI8/ikStffT67Gf2WYmyrZDSHeMqYe+R57yHfCZCqrDPMGS13+1v/HQsE0iYhl2i8CezxjRmydDh6TZgFHeehv8UJhPcLUujA7GO"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Thunderbird/3.1.16 In-Reply-To: Cancel-Lock: sha1:QZ05LYWNSNbsXaxKez5CUV52FfU= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11368 glen herrmannsfeldt wrote: > Lew wrote: > (snip) >> Why in the heck would you recommend 'double' as a time, date or interval type? >> It's very inappropriate. > > With an available 64 bit integer type, I agree. Use long, not double. That might work for intervals, but not dates or times. 'double' is just fine for intervals. 'long' is not at all fine for dates or times. I outlined the reasons upthread, which apparently you ignored, but the bottom line is that you have to reinvent 'java.util.Calendar' if you use 'long' to represent date/time types, and it's not typesafe. Really bad idea. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg