secondsBetween function

int secondsBetween(
  1. DateTime from,
  2. DateTime to
)

Implementation

int secondsBetween(DateTime from, DateTime to) {
  from = DateTime(from.year, from.month, from.day, from.hour, from.minute, from.second);
  to = DateTime(to.year, to.month, to.day, to.hour, to.minute, to.second);
  return (to.difference(from).inSeconds).round();
}