I have two objects: p4 and p5, which have a Date property. In some cases, the constructor works fine:
p4.setClickDate(new Date(System.currentTimeMillis() - 86400000 * 4));
Sets the date Sun Sun Jul 31 11:01:39 EDT 2011
And in other situations, this is not so:
p5.setClickDate(new Date(System.currentTimeMillis() - 86400000 * 70));
Sets the date Fri Jul 15 04:04:26 EDT 2011
According to my calculations, this should set the date to 70 days, no?
I can get around this with Calendar, but I'm curious why Date behaves this way.
Thanks!
source share