[Bug]: datetime.strptime is broken
@msimacek is already working on this.
Since Jul 13, 2026.
Assessment
This issue has not been assessed yet.
Description
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
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 155
- Avg merge
- 8h 58m
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from oracle/graalpython
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
oracle/graalpython#1105 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
oracle/graalpython#1102 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
oracle/graalpython#1157 · 1 assignee ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 74/100
oracle/graalpython#1133 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
oracle/graalpython#1112 ·
All issues in oracle/graalpython
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·