[Bug]: datetime.strptime is broken
Open
@msimacek is already working on this.
Since Jul 13, 2026.
bug
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 155
- Avg merge
- 9h 42m
- Merged PRs (30d)
- 36
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
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.
Assessment
This issue has not been assessed yet.