Used a non deprecated version of Date in Java