Giter VIP home page Giter VIP logo

delorean's Introduction

Delorean: Time Travel Made Easy

delorean is a library for clearing up the confusion that is the datetime module. It will provide natural language improvements for manipulating time, as well as datetime and time abstractions for easy use.

Pretty much make you a badass, time traveller

https://github.com/myusuf3/delorean/raw/master/misc/delorean_brochure3_811.jpg

Usage

Note: This API is in flux still trying to soldify API.

The overall goal is to improve date and time manipulations, as well as help create a simple way for detecting timezones in various areas as well as providing standardized time in utc.

import delorean

'''
All date, times, and datetimes returned are all UTC, if you require, something localized
you are to set it yourself. This will provided via API, this is done to simplify and standardize
the time library you are always aware of what you are working with.
'''

>>> today = delorean.today()
<DelorianDateTime: 2011-09-19>

>>> tomorrow = today.tomorrow()
<DelorianDateTime: 2011-09-20>

>>> tomorrow.date()
2011-09-20 (python Date Object)

>>>tomorrow.datetime()
2011-09-20 00:00:00  (python DateTime Object) significant bits are zeroed
out cause we only started with a date,
but its still a datetime object.

>>>tomorow.time()
00:00:00 (python Time Object) since only a date object was created with date)
>>> next_year = delorean.nextyear()
<DelorianDateTime: 2012-09-19>


>>> gmt = delorean.time()
08:06:53 (python Time Object)

>>> us_eastern = delorean.time(east_coast) this accepts
13:06:53(python Time Object)

>>> now = delorian.datetime().now()
2011-09-19 08:06:53 (python DateTime Object)

>>> utc = delorian.datetime().utcnow()
2011-09-19 08:06:53 (python DateTime Object)

>>> local = delorian.localnow()
2011-09-19 13:06:53 (python DateTime Object) localized. tz set using local. all accept tz value like 'America/Montreal'

delorean's People

Contributors

myusuf3 avatar

Watchers

 avatar

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.