This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

Re: mktime()


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


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