You ask the "number of seconds" of a time_t
. This would be absolute time. You'd want probably then want to format it using localtime()
or some such function in hour/minute/second, day/month/year form.
If you want to know the time since a previous event, you should simply save the time_t
from that event and then use a statement like if (difftime(thisevent_time, lastevent_time) > max_seconds)
to handle it.