Incorrect derivation of the day field in the local run number generation
Description
It should have been addressed in !298 (merged), but it wasn't...
The interpretation of the tm_yday
field of the struct tm
is incorrect: the field starts at 0
on the 1st of January and as such should be used as-is in the local run number creation formula. This is required in order to be able to easily deduce the run timestamp from the local run number itself.
Possible fixes
Replace:
localRunNumber += ((now.tm_year - 100) * 365 + now.tm_yday - 1) * 100'000; // Epoch on 1 January 2000 00:00:00 UTC
by:
localRunNumber += ((now.tm_year - 100) * 365 + now.tm_yday) * 100'000; // Epoch on 1 January 2000 00:00:00 UTC
in the gem::supervisor::GEMSupervisor::getNewLocalRunNumber()
function.