CIME.utils.format_time

CIME.utils.format_time(time_format, input_format, input_time)[source]

Converts the string input_time from input_format to time_format Valid format specifiers are “%H”, “%M”, and “%S” % signs must be followed by an H, M, or S and then a separator Separators can be any string without digits or a % sign Each specifier can occur more than once in the input_format, but only the first occurence will be used. An example of a valid format: “%H:%M:%S” Unlike strptime, this does support %H >= 24

>>> format_time("%H:%M:%S", "%H", "43")
'43:00:00'
>>> format_time("%H  %M", "%M,%S", "59,59")
'0  59'
>>> format_time("%H, %S", "%H:%M:%S", "2:43:9")
'2, 09'