G
Guest
Hello everyone,
In MSDN for time function,
time_t time(
time_t *timer
);
http://msdn2.microsoft.com/en-us/library/1f4c8f33(VS.80).aspx
the return value of time is time_t, but in the Return Value section, it
mentioned,
Return the time as seconds elapsed since midnight, January 1, 1970. There is
no error return.
So, I am wondering whether time_t could be represented as elapsed number of
seconds correctly and safely -- no data lost if we convert return value to
unsigned long?
Like,
unsigned long second = time (NULL);
thanks in advance,
George
In MSDN for time function,
time_t time(
time_t *timer
);
http://msdn2.microsoft.com/en-us/library/1f4c8f33(VS.80).aspx
the return value of time is time_t, but in the Return Value section, it
mentioned,
Return the time as seconds elapsed since midnight, January 1, 1970. There is
no error return.
So, I am wondering whether time_t could be represented as elapsed number of
seconds correctly and safely -- no data lost if we convert return value to
unsigned long?
Like,
unsigned long second = time (NULL);
thanks in advance,
George