I would like to display the previous date How do I do that?
i used this methode for display the date of today, i also want to display the previous date.
static final DateTime now = DateTime.now();
static final DateFormat formatter = DateFormat('dd-MM-yyyy');
final String formatted = formatter.format(now);
final now = DateTime.now();
final today = DateTime(now.year, now.month, now.day);
final yesterday = DateTime(now.year, now.month, now.day - 1);
final tomorrow = DateTime(now.year, now.month, now.day + 1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With