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 :: flutter date input field 
Dart :: input in dart 
Dart :: loop over list dart 
Dart :: settimeout dart 
Dart :: flutter check if drawer is open 
Dart :: flutter appbar default padding 
Dart :: flutter only portrait 
Dart :: app bar textStyle flutter 
Dart :: flutter upgrade pubspec 
Dart :: flutter sliver 
Dart :: snackbar in flutter 
Dart :: dart time 
Dart :: remove item form list by index dart 
Dart :: flutter array filter 
Dart :: class in dart 
Dart :: how to use future Dropownitem list in flutter 
Dart :: flutter snackbar top 
Dart :: dart any 
Dart :: dart list 
Dart :: if else dart example 
Dart :: most used extentions for flutter 
Dart :: dart fixed length list 
Dart :: flutter increment decrement widget 
Dart :: ruby on rails db migrate 
Dart :: flutter button sound effects 
Dart :: future as a parameter with async in flutter 
Dart :: flutter container padding 
Dart :: Ascending order with for loop in dart 
Swift :: random string swift 
Swift :: swift stackview content inset 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =