From 02d5cfd14d4547a239db735d66016c3d0778a4ad Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Tue, 15 Jan 2013 11:36:12 -0500 Subject: [PATCH] add comment about time format conversion --- lms/djangoapps/courseware/access.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lms/djangoapps/courseware/access.py b/lms/djangoapps/courseware/access.py index 64bef8fa1a..c7e09526c9 100644 --- a/lms/djangoapps/courseware/access.py +++ b/lms/djangoapps/courseware/access.py @@ -393,6 +393,8 @@ def _adjust_start_date_for_beta_testers(user, descriptor): debug("Adjust start time: user in group %s", beta_group) # time_structs don't support subtraction, so convert to datetimes, # subtract, convert back. + # (fun fact: datetime(*a_time_struct[:6]) is the beautiful syntax for + # converting time_structs into datetimes) start_as_datetime = datetime(*descriptor.start[:6]) delta = timedelta(descriptor.days_early_for_beta) effective = start_as_datetime - delta