Cleanup of date calculation code

This commit is contained in:
Dev 2024-02-23 16:10:18 +00:00
parent 386aeee9d7
commit b5cde813a3

View File

@ -73,12 +73,10 @@ export class WeatherGenerator
{ {
// tarkov time = (real time * 7 % 24 hr) + 3 hour // tarkov time = (real time * 7 % 24 hr) + 3 hour
const russiaOffset = (this.timeUtil.getHoursAsSeconds(3)) * 1000; const russiaOffset = (this.timeUtil.getHoursAsSeconds(3)) * 1000;
const tarkovTime = new Date( return new Date(
(russiaOffset + (new Date().getTime() * this.weatherConfig.acceleration)) (russiaOffset + (new Date().getTime() * this.weatherConfig.acceleration))
% (this.timeUtil.getHoursAsSeconds(24) * 1000), % (this.timeUtil.getHoursAsSeconds(24) * 1000),
); );
return new Date(tarkovTime);
} }
/** /**