删除无用数据
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
,luogan,luogan-Precision-Tower-3620,09.04.2018 09:15,file:///home/luogan/.config/libreoffice/4;
|
|
||||||
@@ -125,12 +125,16 @@ def get_region(city):
|
|||||||
|
|
||||||
|
|
||||||
def get_weekend():
|
def get_weekend():
|
||||||
|
"""
|
||||||
|
返回本周周末
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
now = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
now = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||||
for day in range(1, 9):
|
for day in range(1, 9):
|
||||||
if calendar.weekday(now.year, now.month, now.day) == 6:
|
if calendar.weekday(now.year, now.month, now.day) == 6:
|
||||||
break
|
break
|
||||||
now = now + datetime.timedelta(days=1)
|
now = now + datetime.timedelta(days=1)
|
||||||
now = now - datetime.timedelta(days=7)
|
now = now - datetime.timedelta(days=14)
|
||||||
pacific = pytz.timezone('Asia/Shanghai')
|
pacific = pytz.timezone('Asia/Shanghai')
|
||||||
return pacific.localize(now)
|
return pacific.localize(now)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user