I have python script which i need to run daily for backups. Now i need to find the date of last saturday because i need that in my script to get the backups i did on last sa
In python script:
from datetime import date from datetime import timedelta today = date.today() last_saturday = today - timedelta(days= (today.weekday() - 5) % 7)
On Mac OS it would be:
$ date -v -sat +"%b-%d-%Y" Mar-28-2015
$ date +"%b-%d-%Y" -d "last saturday" Jul-13-2013