pendulum icon indicating copy to clipboard operation
pendulum copied to clipboard

from_format ignores tz paarametr end uses system timezone instead

Open banderlog opened this issue 10 months ago • 1 comments

  • [ x] I am on the latest Pendulum version.

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

  • OS version and name: Ubuntu 22.04.3 LTS

  • Pendulum version: 2.1.2

Issue

from_format() ignores tz parametr end uses system timezone instead.

import pendulum

pendulum.from_format('10-12-2022 00:00:00', 'DD-MM-YYYY HH:mm:ss')
# or
pendulum.from_format('10-12-2022 00:00:00', 'DD-MM-YYYY HH:mm:ss', tz='UTC')

Will drop an error pendulum.tz.zoneinfo.exceptions.InvalidTimezone: Invalid timezone "Europe/Kyiv"

Because

$ cat /etc/timezone
Europe/Kyiv

banderlog avatar Oct 07 '23 13:10 banderlog

I would say the problem is not supporting the actual timezone name!

drtwisted avatar Apr 05 '24 07:04 drtwisted