Say I have a specific instant in time where I know the hour, minute, day, second, month, year, etc; how can I convert this epoch time (seconds since 1970)?
I can\'t
mktime and memset is most portable for me:
struct tm t; memset(&t, 0, sizeof(tm)); // Initalize to all 0's t.tm_year = 112; // This is year-1900, so 112 = 2012 t.tm_mon = 8; t.tm_mday = 15; t.tm_hour = 21; t.tm_min = 54; t.tm_sec = 13; time_t time_since_epoch = mktime(&t);