取巧实现如下,具体题目 import time class Solution: def dayOfYear(self, date: str) -> int: return time.strptime(date, "%Y-%m-%d")[-2] 题目评论区