Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

time difference flutter

int daysBetween(DateTime from, DateTime to) {
     from = DateTime(from.year, from.month, from.day);
     to = DateTime(to.year, to.month, to.day);
   return (to.difference(from).inHours / 24).round();
  }

   //the birthday's date
   final birthday = DateTime(1967, 10, 12);
   final date2 = DateTime.now();
   final difference = daysBetween(birthday, date2);
 
PREVIOUS NEXT
Tagged: #time #difference #flutter
ADD COMMENT
Topic
Name
1+9 =