#include <iostream>
#include <cstring>
#include <ctime>
#include <iomanip>  // for std::put_time
using namespace std;

time_t test (unsigned int date, unsigned int hhmmss)
{
	int yyyy = (int) date / 10000;
    int mn   = (int) date / 100 - (yyyy * 100);
    int dd   = (int) date - (yyyy * 10000) - (mn * 100);

    struct tm t;
    memset(&t, 0, sizeof(t));

    t.tm_year = yyyy - 1900;
    t.tm_mon  = mn - 1;
    t.tm_mday = dd;
    t.tm_hour = hhmmss / 10000;
    t.tm_min  = hhmmss / 100 - (t.tm_hour * 100);
    t.tm_sec  = hhmmss - (t.tm_hour * 10000) - (t.tm_min * 100);
    t.tm_isdst = -1;
    return mktime(&t);
}

int main() {
	time_t ttt = test(20250528, 112299);
	std::tm* local_tm = std::localtime(&ttt);  // convert to local time structure

    std::cout << "Current time: "
              << std::put_time(local_tm, "%Y-%m-%d %H:%M:%S") << std::endl;
	cout << "ok." << endl;
	return 0;
}