Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

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';
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Flutter #Dart #Difference #Two #DateTime
ADD COMMENT
Topic
Name
5+4 =