You will have to use some conversions. Think about what a year is - 365 days. A day is 24 hours, an hour is 60 minutes, and a minute is 60 seconds. Using these values, you should be able to convert the timestamp into total seconds. The other problem you have is how to actually get these values from the input - which depends greatly on how you want your program to work.
Are you reading this in all at once into a string? Is this user input or from a file? Information like this will help experts help you ;)
I have a file with a timestamps and the data. but I created a panel where I will just paste the timestamps(Starting and final timestamps) so the data in between those two inputs gets processed.
So I guess it's a user input...
Unfortunately we don't have a programming class at school so.. eeh (0_0)
Thanks a lot!!! :)
//
I found something like this:
ime_t StringToTimestamp(const char *time_string)
{
struct tm time_in = {0};
char *tmp = NULL;
time_in.tm_year = strtoul(time_string + 6, &tmp, 10) - 1900;
time_in.tm_mon = strtoul(time_string, &tmp, 10) - 1;
time_in.tm_mday = strtoul(time_string + 3, &tmp, 10);
/* Convert the date in seconds (since 1/1/1970) */
return mktime(&time_in);
//} /* StringToTimestamp */
-----------------
But I can't say I understand everything what's going on... trying to read some things in help...