bin/date-block @ 4ffd09c459f6
More
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Thu, 28 Aug 2025 15:30:29 -0400 |
parents | 04c414408de5 |
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)