There is an existing function naarad.utils.get_standardized_timestamp that does similar thing. Reuse or extend that ?