Last active
January 5, 2023 02:55
-
-
Save montyr75/09b5dc9a20ba01955872 to your computer and use it in GitHub Desktop.
Find the last day of the current month with Dart's DateTime class.
This file contains 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 now = DateTime.now(); | |
final lastDayOfMonth = DateTime(now.year, now.month + 1, 0); | |
print("${lastDayOfMonth.month}/${lastDayOfMonth.day}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks I have done that but thanks for help Appreciated.