python获取昨日日期
获取昨日日期
oneday = datetime.timedelta(days=1) 一天
day = datetime.datetime.strptime(self.date,'%Y-%m-%d')
day2 = day - oneday
或者
today = datetime.date.today()
yesterday = str(today - datetime.timedelta(days=1))
纵然世间炎凉百态!我自依旧初心不改!!
获取昨日日期
oneday = datetime.timedelta(days=1) 一天
day = datetime.datetime.strptime(self.date,'%Y-%m-%d')
day2 = day - oneday
或者
today = datetime.date.today()
yesterday = str(today - datetime.timedelta(days=1))