Python Day of Week
April 22, 2010 1 Comment
I was creating a plugin for Nagios which needed to define thresholds based on time of day and day of week. A lot of searching took me to one really nice function:
localtime. You can use it as below.
from time import localtime
The output is something like this: (2010, 4, 22, 15, 35, 48, 3, 112, 1). This output contains data in the following order: year, month, day, hour, minute, second, day of week, day of year, and I don’t know what is the last column.