added time formatting and parsing