Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - strftime and gmtime invalid output: (2 Items)
   
strftime and gmtime invalid output  
Hello,

I am using QNX 6.3.0 and am seeing some strange behavior with strftime.  The following is a code snippet:

//Convert back to GMT calendar structure
time = *(gmtime(&unix_time));

//Create time string for message
strftime(mTimeBuffer, sizeof(mTimeBuffer), "%Y-%m-%dT%H:%M:%S", &time);


After running my system for a few days I start seeing strange invalid outputs from strftime with years greater than 2038
.

Now it is my understanding that with a 32 bit value passed to gmtime, it should not be possible to receive a year passed
 2038 as that is when unix time wraps 32 bits.  Is there some way gmtime or strftime could be getting some invalid input
 that could cause this?

Thanks
Re: strftime and gmtime invalid output  
Never mind.  Turns out QNX uses an unsigned number for time, so it doesn't wrap until 2106.