From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1b4c8833403a1047,start X-Google-Attributes: gidfee84,public From: Gareth Owen Subject: [Q] - BUG in strptime() DEC UNIX Date: 1996/03/18 Message-ID: <827141482snz@spclmway.demon.co.uk>#1/1 X-Deja-AN: 143367161 x-mail2news-path: spclmway.demon.co.uk x-nntp-posting-host: spclmway.demon.co.uk organization: Siemens Traffic Controls Limited, UK reply-to: geo@spclmway.demon.co.uk newsgroups: comp.unix.osf.osf1 The strftime() function in DEC UNIX 3.0 (347) appears to behave strangely when confronted by the 29th february. When i try and convert the 29th feb (with or without a leap year as the date) the function returns NULL (indicating error) but still correctly fills the struct tm. If I pass in a date like 35th feb it correctly returns NULL and doesn't fill the struct tm. Is this a bug and is there a fix? cheers Gareth Owen ============= code example: { char *conversion_end; struct tm leap_time; char time_string[BUFSIZ]; memset (&leap_time, 0, sizeof(leap_time)); conversion_end = strftime("29/02/96", "%d/%m/%y", &leap_time); if (conversion_end == (char *)NULL) { printf("conversion failed\n"); } else { printf("conversion succeeded\n"); } strftime(time_string, BUFSIZ, "%d/%m/%y", &leap_time); printf("%s\n", time_string); }