Giter Site home page Giter Site logo

Comments (6)

sdispater avatar sdispater commented on August 15, 2024

Could you execute the following in both cases?

>>> from pendulum.tz import LocalTimezone
>>> print(LocalTimezone.get_local_tz_name())

from pendulum.

scktt avatar scktt commented on August 15, 2024

Windows

>>> from pendulum.tz import LocalTimezone
>>> print(LocalTimezone.get_local_tz_name())
Australia/Sydney

Unix

>>> from pendulum.tz import LocalTimezone
>>> print(LocalTimezone.get_local_tz_name())
<Timezone [Australia/Sydney]>

i have a local copy of this repo to fix 8976633 as it wasn't in pip at the time. my local copy at this commit is working, seems it was broken sometime after this commit.

from pendulum.

sdispater avatar sdispater commented on August 15, 2024

OK. So it seems datetime.utcfromtimestamp() does not accept negative timestamps on Windows for some reason. It works fine on other systems.

I will try to make a workaround to fix this.

from pendulum.

sdispater avatar sdispater commented on August 15, 2024

I just pushed a fix on master that should fix the issue.

Can you test it and confirm?

from pendulum.

scktt avatar scktt commented on August 15, 2024

thanks @sdispater, that looks to have fixed the issue.

(.env) C:\projects\timetracking\primetime\pendulum (master)
λ git log -1
commit 5b90e397e440c27673b2dd4332745dd5f70c95a1
Author: Sébastien Eustace <[email protected]>
Date:   Tue Sep 20 23:56:49 2016 -0500

    Fixes Loader class on Windows.

(.env) C:\projects\timetracking\primetime\pendulum (master)
λ python
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pendulum
>>> pendulum.now()
<Pendulum [2016-09-21T15:05:53.545422+10:00]>
>>>

from pendulum.

sdispater avatar sdispater commented on August 15, 2024

Version 0.6.2 is out with the fix included.

from pendulum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.