(self, form=None)
| 98 | raise 'bad format' |
| 99 | |
| 100 | def GetDate(self, form=None): |
| 101 | if form is None: |
| 102 | form = self.__form |
| 103 | if form == format.mdyy: |
| 104 | return str(self.__month)[-2:].zfill(2) + '/' + str(self.__day)[-2:].zfill(2) + '/' + str(self.__year)[-4:].zfill(4) |
| 105 | elif form == format.yymd: |
| 106 | return str(self.__year)[-4:].zfill(4) + '/' + str(self.__month)[-2:].zfill(2) + '/' + str(self.__day)[-2:].zfill(2) |
| 107 | elif form == format.mdy: |
| 108 | return str(self.__month)[-2:].zfill(2) + '/' + str(self.__day)[-2:].zfill(2) + '/' + str(self.__year)[-2:].zfill(2) |
| 109 | elif form == format.ymd: |
| 110 | return str(self.__year)[-2:].zfill(2) + '/' + str(self.__month)[-2:].zfill(2) + '/' + str(self.__day)[-2:].zfill(2) |
| 111 | else: |
| 112 | raise 'bad format' |
| 113 | |
| 114 | def GetDateShort(self): |
| 115 | return time.strftime('%a %b %d, %Y', time.strptime(self.GetDate(format.mdyy), '%m/%d/%Y')) |
no test coverage detected