Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

DateTime::subtract fails when nanosecond result crosses midnight

Abierto
#1,720 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@fglock ya está trabajando en esto.

Desde el 9/10/2026.

  • #1724 de @fglock — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java
Área
backend

Línea de trabajo

The failure is in DateTime 1.67's t/10subtract.t at line 156, where subtracting one nanosecond from midnight passes nanosecond => -1 into DateTime validation. Start by running that focused test on the PerlOnJava JVM and interpreter backends and compare with system Perl. Done means the test passes on both backends. Linked PR #1724 is already open against this issue, so check it before starting.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:runtime bug high-impact

Summary

DateTime::subtract fails when a subtraction crosses midnight by one nanosecond. It passes nanosecond => -1 into DateTime's validation instead of normalizing the result to the previous second/day.

Reproduction

DateTime 1.67's t/10subtract.t reaches the failing case at line 156, subtracting one nanosecond from midnight. PerlOnJava aborts after the preceding 37 assertions with an invalid nanosecond error.

The focused test passes with system Perl 5.45.4 (perl5/perl) and DateTime's full 1.67 suite passes on that oracle. The focused test fails on both PerlOnJava execution backends: JVM and interpreter.

This was observed during CPAN release acceptance run 20261009-194921-60036.

Impact

The failure is in DateTime's pure-Perl subtraction path. DateTime currently has about 950 unique runtime reverse dependants (558 with recent CPAN releases), including Monitoring-Sneck, Travel-Status-MOTIS, BarefootJS, App-ElasticSearch-Utilities, Test2-Harness-UI, and Dist-Zilla.

Other DateTime failures in this acceptance run involve goto from a sort comparator and are tracked separately in #1634; this issue is only for nanosecond normalization.

Lenguaje dominante
Perl
Estrellas
64
Forks
7
Merge medio
5 h 11 min
PR fusionados (30 d)
186

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fglock/PerlOnJava

Todos los issues de fglock/PerlOnJava

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.