1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| def date_months_2(datime): a, b, c = datime.split('-') now = arrow.get(int(a), int(b), int(c)) last_month = str(now.shift(months=-2))[:10] return last_month
def date_months_1(datime): a, b, c = datime.split('-') now = arrow.get(int(a), int(b), int(c)) last_month = str(now.shift(months=-1))[:10] return last_month
def date_days(value): date = date_months_2(value) a, b, c = date.split('-') now = arrow.get(int(a), int(b), int(c)) last_month = str(now.shift(days=+1))[:10] return last_month
|