Modified return datetime output to a format without colons, which could be problematic for filenaming.

This commit is contained in:
2024-07-10 09:47:56 +02:00
parent 0a0b4ac41d
commit 2ce925735d

View File

@ -101,16 +101,12 @@ def make_file_copy(source_file_path, output_folder_name : str = 'tmp_files'):
return tmp_file_path
def created_at():
now = datetime.datetime.now()
# Populate now object with time zone infotmation obtained from the local system
# Populate now object with time zone information obtained from the local system
now_tz_aware = now.astimezone()
tz = now_tz_aware.strftime('%z')
#created_at = now_tz_aware.strftime('%Y-%m-%d_%H-%M-%S')+'_utcoffset_' + tz
#created_at = now_tz_aware.strftime('%Y-%m-%d')+'_UTC-OFST_' + tz
created_at = now_tz_aware.strftime('%Y-%m-%d %H:%M:%S') +'_UTC-OFST_' + tz
# Make created at timestamp with tz information
#created_at = now.isoformat()
# Replace colons in the time part of the timestamp with hyphens to make it file name friendly
created_at = now_tz_aware.strftime('%Y-%m-%d_%H-%M-%S') + '_UTC-OFST_' + tz
return created_at
def dataframe_to_np_structured_array(df: pd.DataFrame):