Search
 
SCRIPT & CODE EXAMPLE
 

DART

dart datetime difference

 //the birthday's date
 final birthday = DateTime(1967, 10, 12);
 final date2 = DateTime.now();
 final difference = date2.difference(birthday).inDays;
Comment

Flutter Dart - Difference Two DateTime

String zamanCevir(DateTime input) {
  Duration diff = DateTime.now().difference(input);

  if (diff.inDays >= 1) {
    return '${diff.inDays} gün önce';
  } else if (diff.inHours >= 1) {
    return '${diff.inHours} saat önce';
  } else if (diff.inMinutes >= 1) {
    return '${diff.inMinutes} dakika önce';
  } else if (diff.inSeconds >= 1) {
    return '${diff.inSeconds} saniye önce';
  } else {
    return 'şimdi';
  }
Comment

PREVIOUS NEXT
Code Example
Dart :: scroll to top flutter 
Dart :: dart continue 
Dart :: flutter return empty widget 
Dart :: how to get value from user in dart 
Dart :: dart timer delay 
Dart :: How to create a small circular dot in FLutter code example 
Dart :: BoxShadow class - painting library - Flutter API 
Dart :: flutter close dialog 
Dart :: flutter dropdown button remove underline 
Dart :: ce button on calculator dart 
Dart :: increase text size of Test flutter 
Dart :: flutter snackbar margin 
Dart :: MaterialStateProperty<Color? flutter 
Dart :: how to put tapping effect on card in flutter 
Dart :: sort list descending from spesific maps key in dart 
Dart :: flutter tooltip margin and padding 
Dart :: change icon color flutter 
Dart :: round off in dart 
Dart :: dart compare two lists 
Dart :: call phone number flutter 
Dart :: flutter get package command 
Dart :: hellow world in dart 
Dart :: dart getter 
Dart :: flutter copy file 
Dart :: flutter appbar default padding 
Dart :: flutter pub upgrade and save pubspec 
Dart :: convert timeofday to string flutter 
Dart :: flutter pass onchanged callback in arguments 
Dart :: swicth statement in flutter 
Dart :: dart keybord input 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =