mktime()

Steven Abner pheonix@zoomtown.com
Wed Aug 24 13:53:00 GMT 2011


On Aug 24, 2011, at 7:07 AM, Corinna Vinschen wrote:

> I think you're right.  Can you please send the simple testcase?

Hi Corinna;
  tm_yday by definition can't have a value of 366 and:

for zone "Pacific/Rarotonga", years 1979-1991:

#include <time.h>
#include <stdlib.h>
#include <stdio.h>
int main(void) {
	time_t t0 = 283996800;
	setenv("TZ", "CKT10CKHST9:30,M10.5.0/0,M3.1.0/0", 1);
	struct tm mtm;
	localtime_r(&t0, &mtm);
	printf("yday = %d\n", mtm.tm_yday);
	mktime(&mtm);
	printf("yday = %d\n", mtm.tm_yday);
	return 0;
}

Cheers,
Steve



More information about the Newlib mailing list