|
@@ -317,3 +317,14 @@ class CommonService:
|
|
|
content = content.decode('utf-8')
|
|
|
content = content[i:-i]
|
|
|
return content
|
|
|
+
|
|
|
+ @staticmethod
|
|
|
+ def timestamp_to_str(timestamp):
|
|
|
+ """
|
|
|
+ 时间戳转时间字符串
|
|
|
+ @param timestamp: 时间戳
|
|
|
+ @return time_str: 时间字符串
|
|
|
+ """
|
|
|
+ struct_time = time.localtime(timestamp)
|
|
|
+ time_str = time.strftime("%Y-%m-%d %H:%M:%S", struct_time)
|
|
|
+ return time_str
|