Time Conversion



I have 2 time values:


System time and an input from the user.


1) System time is in the form of seconds from 1/1/1970 calculated by
using


time_t secs;
SYSTEMTIME stime;


time(&secs);


2) The input from the user is in form hr:min:sec which is a string
value.


But the seperate values have been obtained by using


sscanf(storedTimeValue, "%d:%d:%d", &hour,&minutes,&seconds);


So now I have 3 integer values for hour,minutes and seconds.


3) I have a function which calculates the time difference between 2
time values,
but both these time values need to be seconds from 1/1/1970.


Is there any way by which,I could convert the user given time into time

in seconds from 1/1/1970,
so that I can get the difference between the system time and the user
given time.

.



Relevant Pages

  • Time conversion in C
    ... System time and an input from the user. ... The input from the user is in form hr:min:sec which is a string ... But the seperate values have been obtained by using ... I have a function which calculates the time difference between 2 ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Time conversion in C
    ... System time and an input from the user. ... SYSTEMTIME stime; ... I have a function which calculates the time difference between 2 ... and convert it to a time_t with the mktime function. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Printout the current timestamp in VxWorks
    ... use timeto get the system time in ... seconds (i.e. calendar time), then use ctime() to get the time into a ... string. ...
    (comp.os.vxworks)
  • Re: formatted date string
    ... I'm looking to get a 4 char date string from the system time in the form ... WWYY. ...
    (microsoft.public.vc.language)