fork(1) download
#include 
#include 
#include 
#include 

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' ;
}
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
74697