bin/date-block @ 69edbcc7ba7b default tip

More
author Steve Losh <steve@stevelosh.com>
date Tue, 25 Mar 2025 14:16:24 -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)