#include <time.h>
#include <string.h>
#include <stdio.h>
#include <iostream>
int main()
{
const char charTime[] = "1:1:1970:20:44:57";
int hh, mm, ss, dd, mth, yy;
sscanf( charTime, "%d:%d:%d:%d:%d:%d", &dd, &mth, & yy, &hh, &mm, &ss);
struct tm when ;
memset( &when, 0, sizeof( struct tm ) ) ; // *****
when.tm_mday = dd;
when.tm_mon = mth - 1 ; // ***** Jan == 0, Dec == 11
when.tm_year = yy - 1900 ; // ***** years since 1900
when.tm_hour = hh;
when.tm_min = mm;
when.tm_sec = ss;
time_t converted = mktime(&when);
std::cout << converted << '\n' ;
}
I2luY2x1ZGUgPHRpbWUuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKQp7CiAgICBjb25zdCBjaGFyIGNoYXJUaW1lW10gPSAiMToxOjE5NzA6MjA6NDQ6NTciOwogICAgaW50IGhoLCBtbSwgc3MsIGRkLCBtdGgsIHl5OwogICAgc3NjYW5mKCBjaGFyVGltZSwgIiVkOiVkOiVkOiVkOiVkOiVkIiwgJmRkLCAmbXRoLCAmIHl5LCAmaGgsICZtbSwgJnNzKTsKCiAgICBzdHJ1Y3QgdG0gd2hlbiA7CiAgICBtZW1zZXQoICZ3aGVuLCAwLCBzaXplb2YoIHN0cnVjdCB0bSApICkgOyAvLyAqKioqKgogICAgd2hlbi50bV9tZGF5ID0gZGQ7CiAgICB3aGVuLnRtX21vbiA9IG10aCAtIDEgOyAvLyAqKioqKiBKYW4gPT0gMCwgRGVjID09IDExCiAgICB3aGVuLnRtX3llYXIgPSB5eSAtIDE5MDAgOyAvLyAqKioqKiB5ZWFycyBzaW5jZSAxOTAwCiAgICB3aGVuLnRtX2hvdXIgPSBoaDsKICAgIHdoZW4udG1fbWluID0gbW07CiAgICB3aGVuLnRtX3NlYyA9IHNzOwoKICAgIHRpbWVfdCBjb252ZXJ0ZWQgPSBta3RpbWUoJndoZW4pOwogICAgc3RkOjpjb3V0IDw8IGNvbnZlcnRlZCA8PCAnXG4nIDsKfQo=