Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: datetime.strptime is broken

Aperta
#1,013 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@msimacek ci sta già lavorando.

Dal 13/7/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug
Describe the bug

Initially, I was thinking that this bug is related to https://github.com/oracle/graalpython/issues/532

But I think it is not. I tested it with the timezone "Europe/Berlin/ which has DST, but the result is the same.

The following code produces the following output

from java.time import ZoneId
from datetime import datetime

print("User Timezone (from -Duser.timezone) " + ZoneId.systemDefault().getId())
start_time = datetime.strptime("2025-09-26 10:00:00", "%Y-%m-%d %H:%M:%S")
print("User Timezone (from -Duser.timezone) " + ZoneId.systemDefault().getId())
2026-07-13 08:59:02.542 [INFO ] [nhab.automation.pythonscripting.test] - User Timezone (from -Duser.timezone) Europe/Berlin
2026-07-13 08:59:02.723 [INFO ] [nhab.automation.pythonscripting.test] - User Timezone (from -Duser.timezone) Etc/UTC

Any subsequent call to the timezone returns only UTC.

I tested this using GraalPy 25.0.1.

Operating system

Linux

CPU architecture

x86_64

GraalPy version

25.0.1

JDK version

No response

Context configuration

No response

Steps to reproduce
from java.time import ZoneId
from datetime import datetime

print("User Timezone (from -Duser.timezone) " + ZoneId.systemDefault().getId())
start_time = datetime.strptime("2025-09-26 10:00:00", "%Y-%m-%d %H:%M:%S")
print("User Timezone (from -Duser.timezone) " + ZoneId.systemDefault().getId())
2026-07-13 08:59:02.542 [INFO ] [nhab.automation.pythonscripting.test] - User Timezone (from -Duser.timezone) Europe/Berlin
2026-07-13 08:59:02.723 [INFO ] [nhab.automation.pythonscripting.test] - User Timezone (from -Duser.timezone) Etc/UTC
Expected behavior

don't change the system timezone

Stack trace

Additional context

No response

Lingua principale
Python
Stelle
1.6k
Fork
155
Merge medio
7h 35m
PR unite (30g)
48

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oracle/graalpython

Tutte le issue di oracle/graalpython

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.