File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 2525
2626
2727def format_timestamp (timestamp : str ) -> str :
28- """Format ISO timestamp to 'YYYY-MM-DD HH:MM:SS'."""
29- try :
30- dt = datetime .fromisoformat (timestamp .replace ("Z" , "+00:00" ))
31- return dt .strftime ("%Y-%m-%d %H:%M:%S" )
32- except (ValueError , AttributeError ):
33- return timestamp
28+ """Format ISO timestamp to 'YYYY-MM-DD HH:MM:SS'.
29+ Args:
30+ timestamp (str): ISO fromatted timestamp
31+
32+ Returns:
33+ (str): the datetime as string formatted as 'YYYY-MM-DD HH:MM:SS'
34+
35+ Raises:
36+ Any execptions returned from formatting the timestamp are propogated to the caller
37+ """
38+ dt = datetime .fromisoformat (timestamp .replace ("Z" , "+00:00" ))
39+ return dt .strftime ("%Y-%m-%d %H:%M:%S" )
3440
3541
3642async def check_git_files_changed (client : "InfrahubClient" , branch : str ) -> bool :
You can’t perform that action at this time.
0 commit comments