JENKINS-20441 Backport code to run on Java 1.6

Fixed imports that won't work in Java 1.6 and fixed SimpleDateFormat issue.