Git Product home page Git Product logo

datetime's Introduction

DateTime

DateTime is a lightweight and performant date and time library with iana timezones support.

Motivation

DateTime does not use native Date object. Instead it uses pre-parsed IANA Time Zone Database directly from JavaScript. That allows to keep it predictable, reliable, and future proof on any platform.

Key features

  • Supports ISO-8601 standard, including intervals and durations
  • Supports timezones and DST
  • Works in any browser on any platform independently from the native Date
  • Very fast
  • Small size – only 10 KB compressed
  • No dependencies
  • 99% covered with unit tests

API documentation

Coming soon.

Performance

DateTime is much faster than any other library with timezones support:

Create a new instance with an array
==================================================================
DateTime × 782,154 ops/sec
MomentJS × 260,938 ops/sec
MomentJS + Timezones × 49,593 ops/sec
Fastest is DateTime

Create a new instance with a string
==================================================================
DateTime × 383,795 ops/sec
MomentJS × 34,681 ops/sec
MomentJS with timezones × 20,491 ops/sec
js-joda with timezones × 20,153 ops/sec
Fastest is DateTime

Create a new instance with a string and format
==================================================================
DateTime × 504,000 ops/sec
MomentJS × 38,349 ops/sec
MomentJS + Timezones × 21,643 ops/sec
Fastest is DateTime

Check datetime-benchmark for details.

Licence

MIT

datetime's People

Contributors

dmitryshimkin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tennorhd

datetime's Issues

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.