Skip to content

[Bug]: datetime.strptime is broken #1013

Open

Description

@HolgerHees

Describe the bug

Initially, I was thinking that this bug is related to #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

Activity

  1. self-assigned this
    on Jul 13, 2026
  2. msimacek commented on Jul 13, 2026

    @msimacek
    Contributor

    Hi @HolgerHees , I believe this should be fixed already in the 25.1.3 release. Can you try updating?

  3. HolgerHees commented on Jul 13, 2026

    @HolgerHees
    Author

    Thanks for the quick response.

    Unfortunately, I cannot test this immediately with that version, as many other things also depend on the graal version.

    I am using GraalPy to implement Python scripting in openHAB.

    However, we will be upgrading to version 25.1.x within the next two months, so I will be able to test it again by then at the latest. Is it okay to leave the bug open until then?

  4. msimacek commented on Jul 13, 2026

    @msimacek
    Contributor

    Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions