1154. 一年中的第几天

exiaohu 于 2021-12-21 发布

题目链接:1154. 一年中的第几天

import datetime


class Solution:
    def dayOfYear(self, date: str) -> int:
        return int(datetime.datetime.strptime(date, '%Y-%m-%d').strftime('%j'))