Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: datetime.strptime is broken

Đang mở
#1,013 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@msimacek đang làm issue này rồi.

Từ ngày 13/7/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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

Ngôn ngữ chính
Python
Star
1.7k
Fork
155
Merge trung bình
5 giờ 7 phút
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của oracle/graalpython

Tất cả issue của oracle/graalpython

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.