def parse_date(date: str, hour_threshold: int = <NUM_LIT:200>):
<EOL>date = date.strip('<STR_LIT>')<EOL>if len(date) == <NUM_LIT:4>:<EOL><INDENT>date += '<STR_LIT>'<EOL><DEDENT>if not (len(date) == <NUM_LIT:6> and date.isdigit()):<EOL><INDENT>return<EOL><DEDENT>now = datetime.utcnow()<EOL>guess = now.replace(day=int(date[<NUM_LIT:0>:<NUM_LIT:2>]),<EOL>hour=int(date[<NUM_LIT:2>:<NUM_LIT:4>]) % <NUM_LIT>,<EOL>minute=int(date[<NUM_LIT:4>:<NUM_LIT:6>]) % <NUM_LIT>,<EOL>second=<NUM_LIT:0>, microsecond=<NUM_LIT:0>)<EOL>hourdiff = (guess - now) / timedelta(minutes=<NUM_LIT:1>) / <NUM_LIT><EOL>if hourdiff > hour_threshold:<EOL><INDENT>guess += relativedelta(months=-<NUM_LIT:1>)<EOL><DEDENT>elif hourdiff < -hour_threshold:<EOL><INDENT>guess += relativedelta(months=+<NUM_LIT:1>)<EOL><DEDENT>return guess<EOL>
Parses a report timestamp in ddhhZ or ddhhmmZ format

This function assumes the given timestamp is within the hour threshold from current date