Windows: set timezone as -3600.

This commit is contained in:
Gerhard Hoffmann 2023-05-11 13:58:33 +02:00
parent 818c67ad63
commit ed9166c226

View File

@ -271,6 +271,7 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
cout << "Total minutes: " << (int)ret_val << endl;
if (ret_val <= 0) return "PARKING NOT ALLOWED";
#ifdef __linux__
#if !defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)
// needed for timezone-correction
#error "!defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)"
@ -281,6 +282,10 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
// also change the value of the variable 'timezone'.
valid_until_datetime_t += timezone;
#endif
#else // windows, only for testing
static const long timezone = -3600;
valid_until_datetime_t += timezone;
#endif
struct tm valid_until_datetime;
memset(&valid_until_datetime, 0x00, sizeof(valid_until_datetime));