Windows: set timezone as -3600.
This commit is contained in:
		@@ -271,14 +271,19 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
 | 
			
		||||
	cout << "Total minutes: " << (int)ret_val << endl;
 | 
			
		||||
    if (ret_val <= 0) return "PARKING NOT ALLOWED";
 | 
			
		||||
 | 
			
		||||
#if !defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)
 | 
			
		||||
    // needed for timezone-correction
 | 
			
		||||
    #error "!defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)"
 | 
			
		||||
#else
 | 
			
		||||
    // timezone correction: localtime() needs argument in UTC-timezone
 | 
			
		||||
    // The global variable 'timezone' is set by tzset(), see
 | 
			
		||||
    // https://linux.die.net/man/3/tzset, so I change of the timezone will
 | 
			
		||||
    // also change the value of the variable 'timezone'.
 | 
			
		||||
#ifdef __linux__
 | 
			
		||||
    #if !defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)
 | 
			
		||||
        // needed for timezone-correction
 | 
			
		||||
        #error "!defined(_SVID_SOURCE) && !defined(_XOPEN_SOURCE)"
 | 
			
		||||
    #else
 | 
			
		||||
        // timezone correction: localtime() needs argument in UTC-timezone
 | 
			
		||||
        // The global variable 'timezone' is set by tzset(), see
 | 
			
		||||
        // https://linux.die.net/man/3/tzset, so I change of the timezone will
 | 
			
		||||
        // 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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user