[uClibc] mktime returns -1

Ming-Ching Tiew mingching.tiew at redtone.com
Wed Jun 8 08:59:43 UTC 2005


I don't seem to be able to get mktime to return anything other than -1.

What am I doing wrong ?

I tested on uclibc 2.9.7.

Test code :-

#include <time.h>
#include <stdio.h>
#include <errno.h>
int main(int argc, char** argv)
{

   struct tm tm;
   time_t t1;

   char* buffer = "03:05:43 Wed Jun 8 2005";

   if( strptime ( buffer, "%I:%M:%S %A %b %d %Y", &tm) != 0 )
   {
        printf("strptime successful\n");
        t1 = mktime(&tm);
        if( t1 == -1 )
          printf("mktime failed, errno=%d\n", errno);
   }
   return 0;
}
~







More information about the uClibc mailing list