Adding a method to format the time