refactoring the format_time method and adding an extra format