From 898d7119f04ab16faed78bc4ccead482ad8c7784 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 4 Jul 2007 02:26:36 +0000 Subject: [PATCH] round up enrolment to day, truncate the rest MDL-10181 --- lib/accesslib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index e02c28b49a..5f1c6dbc96 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2295,8 +2295,10 @@ function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0, $enrol=NU function enrol_into_course($course, $user, $enrol) { $timestart = time(); + // remove time part from the timestamp and keep only the date part + $timestart = make_timestamp(date('Y', $timestart), date('m', $timestart), date('d', $timestart), 0, 0, 0); if ($course->enrolperiod) { - $timeend = time() + $course->enrolperiod; + $timeend = $timestart + $course->enrolperiod; } else { $timeend = 0; } -- 2.39.5