GithubHelp home page GithubHelp logo

Comments (5)

Miserlou avatar Miserlou commented on August 18, 2024

(Internally it should be pretty simple, this works:

dt = datetime.fromtimestamp(mktime(struct))
maya_dt = MayaDT.from_datetime(dt)

the trick would just be getting a validator right.)

I can work on this if it's in scope.

from maya.

Miserlou avatar Miserlou commented on August 18, 2024

And, I guess more generally, a load method would be useful as I have multiple sources of dates that could be in various string formats and python formats. Currently, Maya requires knowledge of the date type when instantiating, it'd be great if I could just throw whatever I've got at it.

from maya.

kennethreitz avatar kennethreitz commented on August 18, 2024

MayaDT.from_struct() would be very welcome (or would be it from_tuple?)

from maya.

kennethreitz avatar kennethreitz commented on August 18, 2024

@Miserlou well that's what maya.parse is for β€”Β it'll just magically take (almost) any machine-readable string and turn it into a MayaDT for you.

from maya.

kennethreitz avatar kennethreitz commented on August 18, 2024

If you can get everything into a string format, that would work well.

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.