艺赛旗获得前一天日期代码

艺赛旗获得前一天日期代码

#!/usr/bin/env Python3
__author__ = '未昔/angelfate'
__date__ = '2019/8/15 10:48'
# -*- coding: utf-8 -*-
import datetime
import time


# 获取当前日期
# formatted_today = today.strftime('%Y%m%d')
formatted_today = '20191001'


    print('------重写艺赛旗代码-----')
    # 当前日期
    try:
        if date == None:  # 如果传入的日期为空
            yesterday_date = (datetime.datetime.now() + datetime.timedelta(days)).strftime(return_format)
        else:
            date_input = datetime.date.fromtimestamp(time.mktime(time.strptime(date, format)))
            yesterday_date = (date_input + datetime.timedelta(days)).strftime(return_format)  # 昨天的日期
            print(yesterday_date)
        return yesterday_date
    except Exception as e:
        raise e

print(dete_dalta())

结果

"D:\Program Files\IS-RPA10\Python\python.exe" E:/python/RPA/spdb/cw/分解操作/节假日跳过/艺赛旗获取当前日期.py
------重写艺赛旗代码-----
20190930
20190930

Process finished with exit code 0