234 @exception FtpDirLineParserError Raised if either of the strings is not |
234 @exception FtpDirLineParserError Raised if either of the strings is not |
235 recognized. |
235 recognized. |
236 """ |
236 """ |
237 try: |
237 try: |
238 month, day, year = [int(part) for part in date.split('-')] |
238 month, day, year = [int(part) for part in date.split('-')] |
239 if year >= 70: |
239 year = 1900 + year if year >= 70 else 2000 + year |
240 year = 1900 + year |
|
241 else: |
|
242 year = 2000 + year |
|
243 except (ValueError, IndexError): |
240 except (ValueError, IndexError): |
244 raise FtpDirLineParserError( |
241 raise FtpDirLineParserError( |
245 "illegal date string '{0}'".format(month)) |
242 "illegal date string '{0}'".format(month)) |
246 try: |
243 try: |
247 hour, minute, am_pm = time[0:2], time[3:5], time[5] |
244 hour, minute, am_pm = time[0:2], time[3:5], time[5] |