Skip to content

Conversation

@phidebian
Copy link

commit 1a9d8ad introduced a bug
printf "%(%Y-%m-%d)T\n" "now in 10 week"
produce
2025-11-13
This fix produce the expecteed
2026-01-22

src/lib/libast/tm/tmxdate.c::1456
case TM_PARTS+4:
tm = tmxtm(tm, tmxtime(tm, zone), tm->tm_zone, 0);
tm->tm_hour += m * 7 * 24;
set |= DAY; <======= TYPO HERE
goto clear_hour;

Since we are updating tm_hour then set HOUR

printf "%(%Y-%m-%d)T\n" "now in 10 week"
produce
2025-11-13
This fix produce the expecteed
2026-01-22

src/lib/libast/tm/tmxdate.c::1456
case TM_PARTS+4:
     tm = tmxtm(tm, tmxtime(tm, zone), tm->tm_zone, 0);
     tm->tm_hour += m * 7 * 24;
     set |= DAY; <======= TYPO HERE
goto clear_hour;

Since we are updating tm_hour then set HOUR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant