3 ms·
Python ships with a standard datetime class which is powerful enough to represent time, and there is a ubiquitous module, dateutil, which extends it to do nearl
by MostAwesomeDude 15y ago
Python ships with a standard datetime class which is powerful enough to represent time, and there is a ubiquitous module, dateutil, which extends it to do nearly anything people need to do with dates regularly.
Additionally, one would normally use an array of names and index it:
days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
that_day_you_wanted = days[x]