bin/dayofweek

20 lines
420 B
Python
Executable File

#!/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"
)
)