Hello Josip,
If you need just to rename the camera labels in the project, then you can use the following code:
chunk = Metashape.app.document.chunk
for camera in chunk.cameras:
if camera.type == Metashape.Camera.Type.Regular:
if "Exif/DateTimeOriginal" in camera.photo.meta.keys():
camera.label = camera.photo.meta["Exif/DateTimeOriginal"].replace(":","").replace(" ", "_")
As for the renaming of the original files, I would suggest to do that using special utilities or file manager extensions. And do that before adding images to Metashape project, otherwise you will need to replace somehow the paths in the project.