I am working with time function and what I inderstand is that if you have now=time(NULL) and you output time you will get the number of seconds that have passed since Jan, 01, 1970. Please correct me if I am wrong on this.
What I am trying to do is have a user input a date and for the program to count seconds from that date. What would now variable have to equal to in this case ?
Depends on the input. Perhaps some date functions can help you?
>Please correct me if I am wrong on this.
The value is the current time, whose value and representation remain unknown to you. It doesn't have to be seconds since the Unix epoch, so you should refrain from relying on that.
>What would now variable have to equal to in this case ?
You shouldn't diddle with time_t. Instead, use the tm struct. You can fill up the members of that structure and then use mktime to portably build a time_t value. From there you can use difftime to get a count of seconds.