Re: Return value of _time64() in VS2005

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Tim Roberts wrote:
> "Heinz Ozwirk" <hozwirk.SPAM@xxxxxxxx> wrote:
> >
> >The common description of time() and _time64() says that the function
> >returns the number of seconds elapsed since midnight of 1970-01-01. If you
> >do not call _time64(0) after 2038-01-18, you can use the first or the third
> >declaration above. (I suggest the first one, because you don't have to
> >change the cast when you decide to use __time64_t instead of DWORD.) But
> >remember that such a program will fail in the late afternoon of 2038-01-18.
>
> Actually, as that program was written, it will still work. In January of
> 2038, time() rolls over from 31 bits to 32 bits. As long as you treat it
> as an unsigned value, it will be fine until 2106.
>
> The problem is that lots of code interprets negative time_t values as
> referring to times between 1903 and 1970.
> --
> - Tim Roberts, timr@xxxxxxxxx
> Providenza & Boekelheide, Inc.

Thankyou guys. It is all clear to me now and my program works as well.

/Babak

.