Giter VIP home page Giter VIP logo

Comments (2)

crsmithdev avatar crsmithdev commented on July 17, 2024

Most of the conversion / time zone errors have been fixed in my latest commit. Still remaining are the round-trip errors, and I'm not sure exactly yet what my approach to ambiguous instantiation or non-existent times will be. Addressed a few of the consistency issues in your gist as well.

* round-trip convert timestamp -> named timezone -> utc
    expected 2002-10-27 05:30:00.000000 UTC+0000
    got        10/27/02 06:30:00.0 +00:00 (UTC)
** convert utc datetime -> named timezone
    expected 2002-10-27 01:30:00.000000 EDT-0400
    got        10/27/02 01:30:00.0 -05:00 (EST)
* convert utc to local timezone
    expected 2010-06-06 21:29:07.730000 MSD+0400
    got        06/06/10 21:29:07.730000 +04:00 (MSD)
    expected 2010-12-06 20:29:07.730000 MSK+0300
    got        12/06/10 20:29:07.730000 +03:00 (MSK)
* date & time in named time zone
    expected 2002-10-27 00:30:00.000000 EDT-0400
    got        10/27/02 00:30:00.0 -04:00 (EDT)
* ambiguous: naive datetime to named timezone - no disambiguation
* non-existing times
* time zones in a distant past
    expected 1915-08-04 22:59:59.000000 WMT+0124
    got        08/04/15 22:59:59.0 +01:24 (WMT)
    expected 1933-05-15 01:30:00.000000 AMT+0020
    got        05/15/33 01:30:00.0 +00:20 (AMT)
    expected 1933-05-15 03:30:00.000000 NST+0120
    got        05/15/33 03:30:00.0 +01:20 (NST)

Thanks for the detailed assessment and test code, it was and continues to be extremely helpful.

from arrow.

zed avatar zed commented on July 17, 2024

I've updated the gist to mark (remove) fixed items. Current results:

* round-trip convert timestamp -> named timezone -> utc
    expected 2002-10-27 05:30:00.000000 UTC+0000
    got        10/27/02 06:30:00.0 +00:00 (UTC)
** convert utc datetime -> named timezone
    expected 2002-10-27 01:30:00.000000 EDT-0400
    got        10/27/02 01:30:00.0 -05:00 (EST)
* convert utc to local timezone
* date & time in named time zone
* ambiguous: naive datetime to named timezone - no disambiguation
* non-existing times
* time zones in a distant past
** seconds in utcoffset (pytz also fails here, datetime limitation)
Examples are from http://pytz.sourceforge.net/

The current failures might be due to the bug in dateutils see https://gist.github.com/3838828

from arrow.

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.