Returns the weekday of the date. The format is as in the time module: Monday is 0 and sunday is 6.
(self)
| 117 | self.year, self.month, self.day = t[:3] |
| 118 | |
| 119 | def weekday(self): |
| 120 | """Returns the weekday of the date. |
| 121 | |
| 122 | The format is as in the time module: Monday is 0 and sunday is 6.""" |
| 123 | a = (14 - self.month)//12 |
| 124 | y = self.year - a |
| 125 | m = self.month + 12*a -2 |
| 126 | d = (self.day + y + y//4 - y//100 + y//400 + (31*m//12))%7 |
| 127 | if d: |
| 128 | ret = d - 1 |
| 129 | else: |
| 130 | ret = 6 |
| 131 | return ret |
| 132 | |
| 133 | def __str__(self): |
| 134 | return "%s, %d-%s-%d" % (Date.Weekdays[self.weekday()], |
no outgoing calls
no test coverage detected