fix
This commit is contained in:
+9
-7
@@ -195,17 +195,19 @@ class imageUtils:
|
||||
print("remove=",imgpath)
|
||||
|
||||
class fileUtils:
|
||||
|
||||
@classmethod
|
||||
def getModificationDate(cls,file_path):
|
||||
return os.path.getmtime(file_path)
|
||||
def getModificationDate(cls,file_path,format="%Y%m%d",not_exists=None):
|
||||
if cls.notExists(file_path): return not_exists
|
||||
file_date = os.path.getmtime(file_path)
|
||||
s = time.localtime(file_date)
|
||||
format_date = time.strftime(format,s)
|
||||
print(f"file={file_path} {format_date}")
|
||||
return format_date
|
||||
|
||||
@classmethod
|
||||
def getModificationDateYMD(cls,file_path,not_exists="9999"):
|
||||
if cls.notExists(file_path): return not_exists
|
||||
file_date = cls.getModificationDate(file_path)
|
||||
s = time.localtime(file_date)
|
||||
ymd = time.strftime("%Y%m%d",s)
|
||||
print(f"file={file_path} {ymd}")
|
||||
ymd = cls.getModificationDate(file_path,"%Y%m%d",not_exists)
|
||||
return int(ymd)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user