mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-25 10:23:42 +01:00
20 lines
420 B
Plaintext
20 lines
420 B
Plaintext
|
#!/usr/bin/env python
|
||
|
#
|
||
|
# Usage: dayofweek <year> <month> <day>
|
||
|
#
|
||
|
# Example: dayofweek 2003 11 6
|
||
|
|
||
|
import sys
|
||
|
from datetime import datetime
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
if len(sys.argv) != 4:
|
||
|
print("Usage: dayofweek <year> <month> <day>")
|
||
|
exit(1)
|
||
|
else:
|
||
|
print(
|
||
|
datetime(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3])).strftime(
|
||
|
"%A"
|
||
|
)
|
||
|
)
|