Hi, @Markus Freitag
Considering your time on the PC UTC + 0
tmFromDatabase.tm_mon = std::stoi("01")-1; // from 0 -11
use std::chrono::system_clock::now() to get the accurate time(ms).
auto currentTime = std::chrono::system_clock::now();
auto difference_ms = std::chrono::duration_cast<std::chrono::milliseconds>(currentTime - std::chrono::system_clock::from_time_t(std::mktime(&dbTime))).count();
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.