year_time_left 0.0.1 copy "year_time_left: ^0.0.1" to clipboard
year_time_left: ^0.0.1 copied to clipboard

A simple Dart package to get the remaining time until the end of the year.

year_time_left #

A simple and easy Dart package to get the remaining time until the end of the year.

This package provides useful information such as how many days, hours, minutes, seconds, milliseconds, microseconds, and approximate months are left until the year ends. It's written in pure Dart and works anywhere Dart runs — no Flutter or platform-specific code required!

Features #

  • Get remaining days, hours, minutes, seconds, milliseconds, and microseconds.
  • Approximate months left until the end of the year.
  • Easy to use with just one class.
  • No external dependencies.

Installation #

Add this to your pubspec.yaml:

dependencies:
  year_time_left: ^0.0.1

Then run:

dart pub get

##Usage

import 'package:year_time_left/year_time_left.dart';

void main() {
  final ytl = YearTimeLeft();

  print('Days left: ${ytl.days}');
  print('Hours left: ${ytl.hours}');
  print('Minutes left: ${ytl.minutes}');
  print('Seconds left: ${ytl.seconds}');
  print('Milliseconds left: ${ytl.milliseconds}');
  print('Microseconds left: ${ytl.microseconds}');
  print('Approx months left: ${ytl.months}');
  
  print('\nFull details: ${ytl.all()}');
}

##Example Output

Days left: 110
Hours left: 2650
Minutes left: 159000
Seconds left: 9540000
Milliseconds left: 9540000000
Microseconds left: 9540000000000
Approx months left: 3.6

Full details: {days: 110, hours: 2650, minutes: 159000, seconds: 9540000, milliseconds: 9540000000, microseconds: 9540000000000, approxMonths: 3.6}

##Contributing Feel free to open issues or submit pull requests! This is a simple package but open for improvements, such as more accurate month calculations, localization, or additional time formats. ##License MIT License © ashu-choudhury

0
likes
140
points
11
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A simple Dart package to get the remaining time until the end of the year.

License

MIT (license)

More

Packages that depend on year_time_left