This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
mktime has problem with 00 year
- From: Mohsen Pahlevanzadeh <mohsen at pahlevanzadeh dot org>
- To: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Thu, 08 Jan 2015 10:13:39 +0330
- Subject: mktime has problem with 00 year
- Authentication-results: sourceware.org; auth=none
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