Small date/time hadling optimizations in the java code