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] | |
On Oct 4, 2011, at 4:15 AM, Corinna Vinschen wrote:
> against current CVS and a describing ChangeLog entry for the entire mktime
WB;
Currently I'd like to submit only these 2 fixes. I have some time so I am slowly walking thru the issues as oppose to before where I wasn't fully aware of newlib's workings and applied a lump sum to get her up and running without understanding. They address the British Isles :) and the updating of struct tm after applying the timezone information.
A program? to demonstrate the later (okay was quick hack, so stop the laughing):
int
main (void) {
struct tm pmt;
setenv("TZ", "FKT4FKST,M9.2.6/24:00:00,M4.3.6/24:00:00", 1);
TZSET();
printf("Jan 1st 1987 occurs on Thursday\n");
time_t now = 536554799;
memset(&pmt, 0, (9 * sizeof(int)));
pmt.tm_min = (int)now / 60;
pmt.tm_sec = (int)now - (pmt.tm_min * 60) - 14400;
/* now Jan 1st of EPOCH */
pmt.tm_mday = 1;
pmt.tm_year = 1970 - 1900;
pmt.tm_isdst = 0;
MKTIME(&pmt);
printf("pmt has Jan the %dst 19%d occuring on %d(4-Thursday) with a yday of %d\n",
pmt.tm_mday, pmt.tm_year, pmt.tm_wday, pmt.tm_yday);
now = 536554800;
memset(&pmt, 0, (9 * sizeof(int)));
pmt.tm_min = (int)now / 60;
pmt.tm_sec = (int)now - (pmt.tm_min * 60) - 14400;
pmt.tm_mday = 1;
pmt.tm_year = 1970 - 1900;
pmt.tm_isdst = 0;
MKTIME(&pmt);
printf("pmt has Jan the %dnd 19%d occuring on %d(5-Friday) with a yday of %d\n",
pmt.tm_mday, pmt.tm_year, pmt.tm_wday, pmt.tm_yday);
setenv("TZ", "EET-2EEST,M3.5.0,M10.5.0/0", 1);
TZSET();
printf("Oct 25th 1987 occurs on Sunday (yday = 297)\n");
now = 562111200;
memset(&pmt, 0, (9 * sizeof(int)));
pmt.tm_min = (int)now / 60;
pmt.tm_sec = (int)now - (pmt.tm_min * 60) + 7200;
pmt.tm_mday = 1;
pmt.tm_year = 1970 - 1900;
pmt.tm_isdst = 1;
MKTIME(&pmt);
printf("pmt has Oct the %dth 19%d occuring on %d(6-Saturday) with a yday of %d\n",
pmt.tm_mday, pmt.tm_year, pmt.tm_wday, pmt.tm_yday);
return 0;
}
pre-fix
Jan 1st 1987 occurs on Thursday
pmt has Jan the 1st 1987 occuring on 4(4-Thursday) with a yday of 0
pmt has Jan the 2nd 1987 occuring on 4(5-Friday) with a yday of 0
Oct 25th 1987 occurs on Sunday (yday = 297)
pmt has Oct the 24th 1987 occuring on 0(6-Saturday) with a yday of 297
post-fix
Jan 1st 1987 occurs on Thursday
pmt has Jan the 1st 1987 occuring on 4(4-Thursday) with a yday of 0
pmt has Jan the 2nd 1987 occuring on 5(5-Friday) with a yday of 1
Oct 25th 1987 occurs on Sunday (yday = 297)
pmt has Oct the 24th 1987 occuring on 6(6-Saturday) with a yday of 296
Attachment:
Change_Log.txt
Description: Text document
Attachment:
mktm_r091311.patch
Description: Binary data
Attachment:
mktime100611.patch
Description: Binary data
Steve
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |