Published by Fabian on 07 Aug 2008 at 10:08 pm
SCJP prepares for the real life…
… at least sometimes …
Today I had my “you forgot what you learned for the SCJP” moment.
long MSEC_PER_YEAR = 365 * 24 * 60 * 60 * 1000;
Despite the fact that this is not not accurate, due to many things (leap year and seconds, possible adjustments to DST), this should match the milliseconds between to dates one year apart.
Well at least I thought so, but the computation is incorrect. I did figure this out after a while (and ended up rewriting it anyways), so I am pretty sure one of my readers can come up with a solution for this “puzzle”