This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mktime has problem with 00 year


Dear all,

mktime crach with 00 time : 1900 - 1900:
//////////////////////////////////////////////////////////
#include <stdio.h>
#include <time.h>

int
main(int argc, char ** argv)
{

    struct tm tm = {0};
    time_t t;

    tm.tm_year = 1900 - 1900;
    tm.tm_mon = 2;
    tm.tm_mday = 1;

    t = mktime(&tm);
    if ( t == -1 )
        printf ("mktime has been crashed!!!!");


}
/////////////////////////////

Do you have any solution?

--Regards,
Mohsen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]