diff --git a/red_fam.py b/red_fam.py index dec14eb..76f087b 100644 --- a/red_fam.py +++ b/red_fam.py @@ -59,6 +59,7 @@ class RED_FAM_PARSER( RED_FAM ): # Define the timestamp format __timestamp_format = "%H:%M, %d. %b. %Y (%Z)" + __timestamp_format2 = "%H:%M, %d. %b %Y (%Z)" # Catch missing point after month abreviation # Define section heading re.pattern __sectionhead_pat = re.compile( r"={3,4}[^=]*={3,4}" ) @@ -179,7 +180,12 @@ class RED_FAM_PARSER( RED_FAM ): if( isinstance( timestamp, datetime ) ): return timestamp else: - return datetime.strptime( timestamp, type( self ).__timestamp_format ) + # Catch missing point after month abreviation + try: + result = datetime.strptime( timestamp, type( self ).__timestamp_format ) + except ValueError: + result = datetime.strptime( timestamp, type( self ).__timestamp_format2 ) + return result def status( self ): """