GithubHelp home page GithubHelp logo

Comments (5)

timofurrer avatar timofurrer commented on August 18, 2024

Was solved with #119 .
Thanks for the bug report 🎉

from maya.

vlcinsky avatar vlcinsky commented on August 18, 2024

either a test case or the code is broken:

    def test_issue_104():
        e = 1507756331
        t = Datetime.utcfromtimestamp(e)
        t = maya.MayaDT.from_datetime(t)
        assert str(t) == 'Wed, 11 Oct 2017 21:12:11 GMT'
        t = time.gmtime(e)
        t = maya.MayaDT.from_struct(t)
>       assert str(t) == 'Wed, 11 Oct 2017 21:12:11 GMT'
E       AssertionError: assert 'Wed, 11 Oct ... 22:12:11 GMT' == 'Wed, 11 Oct 2017 21:12:11 GMT'
E         - Wed, 11 Oct 2017 22:12:11 GMT
E         ?                   ^
E         + Wed, 11 Oct 2017 21:12:11 GMT
E         ?                   ^

tests/test_maya.py:80: AssertionError
=================================================

Tested on commit:

commit 15a5c9eedb52886fc8f59bc31d608066bedb11e4
Merge: b411d5e 7c5d587
Author: Timo Furrer <[email protected]>
Date:   Fri Mar 30 11:19:14 2018 +0200

from maya.

timofurrer avatar timofurrer commented on August 18, 2024

The problem seems to be that time.gmtime(1507756331) is not in DST, however MayaDT.from_struct() uses the current time (which is currently in DST) to calculate the UTC offset. Thus, there's a mismatch between DST.

I'll have a look at it ;)

from maya.

vlcinsky avatar vlcinsky commented on August 18, 2024

My timezone is CEST (Central European Summer Time, thus +02:00)

I will try creating a test changing timezones using freezegun.

from maya.

timofurrer avatar timofurrer commented on August 18, 2024

The problem was because of DST not because of your timezone. I've already fixed it with 5f6b5fc

I'll have a look at your test though.

from maya.

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.