Created
April 9, 2020 17:31
-
-
Save yakubpashask/47f5f45bb959da0f3e042e30ad4b0365 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final yesterday = DateTime(now.year, now.month, now.day); // today 12.00.00 | |
final tomorrow = DateTime(now.year, now.month, now.day +1); //tomorrow 12.00.00 | |
int diffInDays = tomorrow.difference(yesterday).inDays; | |
if (diffInDays == 0){ | |
//custom code | |
print( "same day"); | |
} else if( diffInDays > 0 ) { | |
// custom code | |
print("tomorrow is greater "); | |
} else{ | |
// custom code | |
print(" yesterday is less" ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment