91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

python根據開始結束日期解析獲得日周月

發布時間:2020-08-19 07:16:23 來源:網絡 閱讀:638 作者:雷頓學院 欄目:編程語言
(b_datedays):
    day = datetime.timedelta(=)
    i (days):
        b_date + day * i


(start_date=end_date=):
    (start_datedatetime.datetime) (end_datedatetime.datetime):
        start = start_date
        end = end_date
    :
        start = datetime.datetime.strptime(start_date)
        end = datetime.datetime.strptime(end_date)
    end = end + datetime.timedelta(=)
    data = []
    d gen_dates(start(end - start).days):
        data.append(d.strftime())
    data
ParseDate(TimeSpecType):
    DaysOneWeek = DaysOneWeek
    DaysOneMonth = DaysOneMonth  ():
        .__choices__ = (
            (.day.parse_date_by_day)(.week.parse_date_by_week)(.month.parse_date_by_month)
        )

    (value):
        _names = ((e[]e[]) e .__choices__)
        _names.get(value) (value):
        _names = ((e[]e[]) e .__choices__)
        _names.get(value) (start_dateend_date):
        weeklist = []
        (start_datedatetime.datetime) (end_datedatetime.datetime):
            start = start_date
            end = end_date
        :
            start = datetime.datetime.strptime(start_date)
            end = datetime.datetime.strptime(end_date)
        max_timedelta = end - start
        max_weeks = (math.ceil(max_timedelta.days / .DaysOneWeek) + )  first_start_week_day = start.weekday()
        first_week_sunday = start + datetime.timedelta(=(.DaysOneWeek - first_start_week_day - ))  first_week_sunday >= end:
            temp = {: start: end}
            weeklist.append(temp)
            weeklist
        :
            temp = {: start: first_week_sunday}
            weeklist.append(temp)
            i (max_weeks):
                monday = first_week_sunday + datetime.timedelta(==i)
                sunday = monday + datetime.timedelta(=)
                monday >= end:
                    temp = {: monday: end}
                    weeklist.append(temp)
                    sunday <= end:
                    temp = {: monday: sunday}
                    weeklist.append(temp)
                :
                    temp = {: monday: end}
                    weeklist.append(temp)
                    weeklist

    (start_dateend_date):
        monthlist = []
        (start_datedatetime.datetime) (end_datedatetime.datetime):
            start = start_date
            end = end_date
        :
            start = datetime.datetime.strptime(start_date)
            end = datetime.datetime.strptime(end_date)
        max_timedelta = end - start
        max_months = (math.ceil(max_timedelta.days / .DaysOneMonth) + )  first_month = start.month  first_year = start.year  firstDayWeekDaymonthlen = calendar.monthrange(first_yearfirst_month)
        last_day_of_first_month = datetime.datetime(=first_year=first_month=monthlen)  last_day_of_first_month >= end:
            temp = {: start: end}
            monthlist.append(temp)
            monthlist
        :
            temp_first_day = last_day_of_first_month + datetime.timedelta(=)
            temp = {: start: last_day_of_first_month}
            monthlist.append(temp)
            i (max_months):
                year = temp_first_day.year
                month = temp_first_day.month
                firstDayWeekDaymonthRange = calendar.monthrange(yearmonth)
                temp_last_day = datetime.datetime(=year=month=monthRange)
                temp_first_day >= end:
                    temp = {: temp_first_day: end}
                    monthlist.append(temp)
                    temp_last_day <= end:
                    temp = {: temp_first_day: temp_last_day}
                    monthlist.append(temp)
                    temp_first_day = temp_last_day + datetime.timedelta(=)
                :
                    temp = {: temp_first_day: end}
                    monthlist.append(temp)
                    monthlist

    (start_dateend_date):
        daylist = []
        days = get_date_list(start_dateend_date)
        day days:
            day_datetime = datetime.datetime.strptime(day)
            temp = {: day_datetime: day_datetime}
            daylist.append(temp)
        daylist


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

阿克苏市| 平陆县| 德格县| 乌拉特前旗| 阿瓦提县| 开远市| 衡南县| 铅山县| 白城市| 睢宁县| 宾川县| 克东县| 祁东县| 祁连县| 朔州市| 柘荣县| 金堂县| 南投县| 廊坊市| 连江县| 天长市| 韶关市| 遂溪县| 江津市| 武宣县| 蓝山县| 桂阳县| 乐清市| 平陆县| 渭南市| 遵义市| 随州市| 永康市| 乌兰县| 修水县| 深州市| 广安市| 西丰县| 兴业县| 乐东| 洛宁县|