ctime_to_iso

grizli.utils.ctime_to_iso(mtime, format='%a %b %d %H:%M:%S %Y', strip_decimal=True, verbose=True)[source]

Convert time.ctime strings to ISO dates

Parameters
mtimestr

Time string, generally as output from time.ctime, e.g., 'Mon Sep 16 11:23:27 2019'

formatstr

datetime.strptime format string, codes at https://www.programiz.com/python-programming/datetime/strptime

strip_decimalbool

Strip decimal seconds from end of ISO string

verbosebool

Print a message if conversion fails

Returns
isostr

String in (sortable) ISO format, e.g., '2019-09-16 11:23:27.000'