added helper functions for converting time