Merge branch 'master' of git.mimbach49.de:GerhardHoffmann/MOBILISIS-Calculator

This commit is contained in:
Siegfried Siegert 2023-05-09 13:04:23 +02:00
commit 31df676b57
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -266,11 +266,19 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg, uint8_t payment_
cout << "Total minutes: " << (int)ret_val << endl;
if (ret_val <= 0) return "PARKING NOT ALLOWED";
struct tm valid_until_datetime = *localtime(&valid_until_datetime_t);
LOG_DEBUG("Ticket is valid until ", asctime(&valid_until_datetime));
struct tm valid_until_datetime = *localtime(&valid_until_datetime_t);
// TEST: no daylight saving time
// valid_until_datetime.tm_isdst = 0;
char buf[128];
memset(buf, 0x00, sizeof(buf));
strftime(buf, sizeof(buf)-1, "%Y-%m-%dT%H:%M:%S", &valid_until_datetime);
// LOG_DEBUG("Ticket is valid until ", asctime(&valid_until_datetime));
LOG_DEBUG("Ticket is valid until ", buf);
total_duration_min = 0.0f;
return asctime(&valid_until_datetime);
return std::string(buf);
}
///////////////////////////////////////