instant 0.5.1 copy "instant: ^0.5.1" to clipboard
instant: ^0.5.1 copied to clipboard

A package that exports functions for converting, formatting, and nicening of dates/times in Dart.

example/instant_example.dart

import 'dart:io';

import 'package:instant/instant.dart';

void main(List<String> args) {
  var SanFran =
      curDateTimeByZone(zone: 'PDT'); //current DateTime in PDT timezone
  print(formatTime(time: SanFran)); //prints current time in PDT
  print(formatDate(date: SanFran)); //prints current date in PDT

  var watch = InstantStopwatch();
  watch.play();
  print(watch.stopwatchInSeconds);
  sleep(Duration(seconds: 2));
  print(watch.stopwatchInSeconds);
  watch.pause();
  sleep(Duration(seconds: 2));
  print(watch.stopwatchInSeconds);
  watch.play();
  sleep(Duration(seconds: 2));
  print(watch.stopwatchInSeconds);

  // This is largely a placeholder with the most barebones of usage. Check the
  // Gitbook and API docs for a much more thorough set of guides and examples.
}
30
likes
140
points
4.12k
downloads

Publisher

verified publisherkishoredev.live

Weekly Downloads

A package that exports functions for converting, formatting, and nicening of dates/times in Dart.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on instant