bin/date-block @ 04c414408de5 default tip
More
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Wed, 05 Mar 2025 11:43:39 -0500 |
parents | (none) |
children | (none) |
#!/usr/bin/env python3 import sys, datetime days = 'mtwhfsu' start_date = datetime.datetime.strptime(sys.argv[1] + ' 12:00:00 UTC', '%Y-%m-%d %H:%M:%S %Z') d = start_date for _ in range(7 * 8): day = days[d.weekday()] date = d.strftime('%Y-%m-%d') if day == 'm': print() print(f"{day} {date}") d += datetime.timedelta(days=1)