https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98507
Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu.org Ever confirmed|0 |1 Last reconfirmed| |2021-12-16 Status|UNCONFIRMED |NEW --- Comment #2 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> --- Confirmed, the logic in gcc/libgfortran/intrinsics/date_and_time.c is faulty: values[3] = (local_time.tm_min - UTC_time.tm_min + 60 * (local_time.tm_hour - UTC_time.tm_hour + 24 * (local_time.tm_yday - UTC_time.tm_yday))); yday will wrap near the new year, giving rise to those huge values. Patch incoming.