GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `now` ignores `TZ` environment variable · Issue #905 · python-pendulum/pendulum

now ignores TZ environment variable #905

New issue
Copy link
New issue
Copy link
Open
#942
Open
now ignores TZ environment variable#905
#942
Copy link
Milestone
Pendulum 3.4

Description

@ariebovenberg
ariebovenberg
opened on Jul 26, 2025
Issue body actions
  • I am on the latest Pendulum version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • OS version and name: MacOS 15.5

  • Pendulum version: 3.1.0

Issue

On posix systems, the TZ environment variable can be used to set the system timezone. It takes precedence over other configuration. Pendulum doesn't appear to account for this.

Example of the bug in action:

$ TZ="Asia/Tokyo" python -c "import pendulum; print(pendulum.now())"
2025-07-26 14:05:16.412699+02:00

It seems to take the local offset (+2, western europe) instead of using TZ (+9). The standard library does this correctly:

$ TZ="Asia/Tokyo" python -c "from datetime import datetime; print(datetime.now().astimezone())"
2025-07-26 21:04:53.050771+09:00

This issue is similar (but not the same) as #497. It appears pendulum 3.0 fixed this inconsistency, but as the cost of ignoring TZ altogether.

edit: formatting

Activity

  1. Secrus commented on Jul 26, 2025

    @Secrus
    Secrus
    on Jul 26, 2025
    Collaborator
    More actions

    Thank you for your report. I added this to Pendulum 3.2 milestone

    Reacted by Arie Bovenberg
  2. Secrus
    added this to the Pendulum 3.2 milestone on Jul 26, 2025
  3. Secrus commented on Feb 25, 2026

    @Secrus
    Secrus
    on Feb 25, 2026
    Collaborator
    More actions

    Update: seems like we forgot to check env variable in Darwin timezone code. I have a draft PR fixing it (#942), but have to figure out a good way to do testing of it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      • Pendulum 3.4No due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.