converted a lot of date functions to use java8 features