Summary
There is an issue with session time calculation in mod/attendance/locallib.php when daylight saving time (DST) changes occur. The current implementation calculates times starting from midnight, which causes incorrect session durations when the clock shifts (e.g., at 02:00).
Code Reference
$sesstarttime = $formdata->sestime['starthour'] * HOURSECS + $formdata->sestime['startminute'] * MINSECS;
$sesendtime = $formdata->sestime['endhour'] * HOURSECS + $formdata->sestime['endminute'] * MINSECS;
$sessiondate = $formdata->sessiondate + $sesstarttime;
$duration = $sesendtime - $sesstarttime;
Problem
The calculation assumes a continuous timeline from midnight (00:00). However, during DST transitions (e.g., when clocks move forward at 02:00), one hour is skipped
Summary
There is an issue with session time calculation in mod/attendance/locallib.php when daylight saving time (DST) changes occur. The current implementation calculates times starting from midnight, which causes incorrect session durations when the clock shifts (e.g., at 02:00).
Code Reference
$sesstarttime = $formdata->sestime['starthour'] * HOURSECS + $formdata->sestime['startminute'] * MINSECS;
$sesendtime = $formdata->sestime['endhour'] * HOURSECS + $formdata->sestime['endminute'] * MINSECS;
$sessiondate = $formdata->sessiondate + $sesstarttime;
$duration = $sesendtime - $sesstarttime;
Problem
The calculation assumes a continuous timeline from midnight (00:00). However, during DST transitions (e.g., when clocks move forward at 02:00), one hour is skipped