Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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]


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: