diff --git a/sm2gen.py b/sm2gen.py index 44691e0..1976023 100644 --- a/sm2gen.py +++ b/sm2gen.py @@ -314,11 +314,11 @@ def check_file_version(filename): # Convert the string timestamp to a datetime object file_timestamp = datetime.strptime(timestamp_str, '%Y-%m-%d %H:%M:%S') - # Get the last modified time of the file - file_modified_time = datetime.fromtimestamp(os.path.getmtime(filename)) + # Get the last modified time of the file, ignoring milliseconds + file_modified_time = datetime.fromtimestamp(os.path.getmtime(filename)).replace(microsecond=0) # Compare the timestamps - if file_modified_time > file_timestamp: + if file_modified_time > (file_timestamp): return f"{filename}.new" else: return filename