1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 07:14:31 +01:00

Use std::chrono for easier to read durations (#23499)

This commit is contained in:
Tulio Leao
2024-12-29 17:48:24 -03:00
committed by GitHub
parent 0ce1128cf0
commit fef568c7c8
4 changed files with 19 additions and 9 deletions

View File

@@ -64,7 +64,9 @@ NewVersionInfo GetLatestVersion()
#ifndef DISABLE_HTTP
auto now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
auto then = Config::Get().general.LastVersionCheckTime;
if (then < now - 24 * 60 * 60)
using namespace std::chrono_literals;
if (then < now - std::chrono::seconds(24h).count())
{
Http::Request request;
request.url = "https://api.github.com/repos/OpenRCT2/OpenRCT2/releases/latest";