date_time 0.11.0 copy "date_time: ^0.11.0" to clipboard
date_time: ^0.11.0 copied to clipboard

Package to work with Date & Time in separation and with its Ranges.

example/README.md

Examples #

import 'package:date_time/date_time.dart';

void main() {
  final dateTime = DateTime.now();
  final date = dateTime.date;
  final time = dateTime.time;

  print('Date is $date');
  print('Time is $time');

  // Compare dates

  final date2 = date.addDays(1);
  final isDate2After = date2 >= date;
  final isDate2After2 = date2.isAfter(date);
  print('Is date2 after: $isDate2After');

  // Compare times
  final time2 = time.addMinutes(30);
  final isTime2After = time2 > time;
  final isTime2After2 = time2.isAfter(time);
  print('Is time2 after: $isTime2After');
}
18
likes
130
points
891
downloads

Publisher

verified publisherdevcraft.ninja

Weekly Downloads

Package to work with Date & Time in separation and with its Ranges.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

clock, intl, json_annotation, quiver

More

Packages that depend on date_time