Instant

Introducing Instant, a new way to handle time in Dart.

What is Instant?

Instant is an open-source Dart package for manipulating DateTimes in Dart. It aims to make your life a little bit easier by processing DateTimes to achieve various purposes. It was inspired by moment.js and Date-fns for JavaScript.

Check out https://pub.dev/packages/instant#-readme-tab- for Instant's pub page.

Every bit of code written for Instant is and always will be compatible with the latest dev, beta, and stable versions of Dart.

What does Instant do?

Instant's primary purpose is formatting of dates and times, but it provides a number of features to provide a seamless integration with the normal DateTime interface:

  • Current DateTimes in any timezone worldwide.

  • Easy and customizable formatting of dates and times into Strings.

  • Methods for formatting with current local DateTime, as well as with user-provided DateTimes.

  • Calculate difference between two DateTimes in years, weeks, days, hours, minutes, seconds, and milliseconds.

  • Provide a Stopwatch class that is a) not asynchronous and b) less memory-intensive

How do I use it?

Last updated