Skip to content

Commit

Permalink
支持时间格式(11点20分)
Browse files Browse the repository at this point in the history
  • Loading branch information
haikerwang committed Sep 17, 2023
1 parent f2a2fe5 commit 1f0a420
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,23 +750,23 @@ def get_time(self, timeStr):
#中文 且 在一 至 六十之间
if re.search('[\u4e00-\u9fa5]', item) and item in digits.keys():
hour = str(digits[item])
elif item in digits.values():
elif item in digits.values() or int(item) in digits.values():
hour = str(item)
else:
return ""

elif index == 1 and len(item) > 0:
if re.search('[\u4e00-\u9fa5]', item) and item in digits.keys():
minute = str(digits[item])
elif item in digits.values():
elif item in digits.values() or int(item) in digits.values():
minute = str(item)
else:
return ""

elif index == 2 and len(item) > 0:
if re.search('[\u4e00-\u9fa5]', item) and item in digits.keys():
second = str(digits[item])
elif item in digits.values():
elif item in digits.values() or int(item) in digits.values():
second = str(item)
else:
return ""
Expand Down

0 comments on commit 1f0a420

Please sign in to comment.