On 32-bit Python, this conversion could overflow, for example, for year 2099. This conversion won't.

This commit is contained in:
Ned Batchelder
2013-02-12 13:41:44 -05:00
parent 537d6dd18e
commit 27e8d699be

View File

@@ -446,7 +446,7 @@ class CourseDescriptor(SequenceDescriptor):
# utility function to get datetime objects for dates used to
# compute the is_new flag and the sorting_score
def to_datetime(timestamp):
return datetime.fromtimestamp(time.mktime(timestamp))
return datetime(*timestamp[:6])
def get_date(field):
timetuple = self._try_parse_time(field)