>From: Chad Stansbury [mailto:[EMAIL PROTECTED]]
>
>Actually, a more proper way is to indicate to the compiler 
>that you want
>long arithmetic by writing:
>
>long millisInMonth = 1000L * 60L * 60L * 24L * 30L

I'm sure it all gets optimized out to the same thing in the end :-)  But
yes, you're right.

I can imagine what engineers 10 years from now are going to be saying
when they write Java code - damn thing only uses 32 bit math by default!
How silly on our (32 * whatever) bit chips!  :-)  It certainly beats
erratic machine-specific behavior though.

>Oh, and by the way, this is not really correct since you're 
>assuming 30 days
>in a month.  You should use the Calendar to figure out how 
>many millis a
>given month actually has since this varies by month and year.

The problem is not that particular.  It's just a "what happened in the
last 30 days" search bound.

Jeff

Reply via email to