From 7abcfde90fcc9b5fadf99b4f8858bac620b197ad Mon Sep 17 00:00:00 2001 From: esea_info Date: Wed, 19 Apr 2023 19:23:01 +0800 Subject: [PATCH] awrams.py year month day --- awrams.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/awrams.py b/awrams.py index c25e970..dd7515a 100644 --- a/awrams.py +++ b/awrams.py @@ -420,9 +420,9 @@ class AWRAMS(object): def getNewFolderFromOldFolder( self, ) -> Path: # 服务器上转移后的模式 tmp_folder = self.old_folder.parent.parent - path_tuple = ("20"+str(self.info_dict['year']) - ,str(self.info_dict['month']) - ,str(self.info_dict['day']) + path_tuple = ("20"+f"{self.info_dict['year']:02d}" + ,f"{self.info_dict['month']:02d}" + ,f"{self.info_dict['day']:02d}" ,self.old_folder.parts[-1] ) self.new_folder =tmp_folder.joinpath(*path_tuple) self.mydir.setBaseDir(self.new_folder) @@ -902,8 +902,10 @@ class AWRAMS(object): except Exception as e: return ret log.debug(temp,__name__,"decode_info") - time_ = "20"+str(temp[0]) + "-" + str(temp[1]) + "-" + str(temp[2]) + " " \ - + str(temp[3]) + ":" + str(temp[4]) + ":" + str(temp[5]) + # time_ = "20"+str(temp[0]) + "-" + str(temp[1]) + "-" + str(temp[2]) + " " \ + # + str(temp[3]) + ":" + str(temp[4]) + ":" + str(temp[5]) + time_ = "20" + f"{str(temp[0])}" + "-" + f"{str(temp[1])}" + "-" + f"{str(temp[2])}" + " " \ + + f"{str(temp[3])}" + ":" + f"{str(temp[4])}" + ":" + f"{str(temp[5])}" ret.update({"time": time_}) ret.update({"year": temp[0]}) ret.update({"month": temp[1]})