Skip to content

Commit

Permalink
Switch to ISO8601 date-time format that is human readable
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochun committed Jun 10, 2021
1 parent 4de4b21 commit 3c771f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ldcoolp/curation/inspection/readme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,9 @@ def update(self):
else:
self.log.info("README.txt changed. Updating!")
st = stat(self.readme_file_path)
mod_time_str = datetime.fromtimestamp(st.st_mtime).strftime('%Y-%m-%d_%H.%M.%S')
mod_time = datetime.fromtimestamp(st.st_mtime)
mod_time_str = mod_time.isoformat(timespec='seconds').\
replace(':', '')
backup_copy_filename = self.readme_file_path.replace('.txt', f'_{mod_time_str}.txt')
self.log.info(f"Saving previous copy as : {basename(backup_copy_filename)}")
shutil.copyfile(self.readme_file_path, backup_copy_filename)
Expand Down

0 comments on commit 3c771f0

Please sign in to comment.