this is a simple question ... is there a way to convert a struct tm ct;
to a long integer ? here's how my code look like:
struct tm ct;
scanf("%d", &ct.tm_sec);
scanf("%d", &ct.tm_min);
scanf("%d", &ct.tm_hour);
scanf("%d", &ct.tm_mday);
scanf("%d", &ct.tm_mon);
scanf("%d", &ct.tm_year);
You can use the mktime()
function to convert a struct tm
into a time_t
, which is an integer value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With