Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Mastersam07/f8ca05bdce771d65c970f741616d2e94 to your computer and use it in GitHub Desktop.

Select an option

Save Mastersam07/f8ca05bdce771d65c970f741616d2e94 to your computer and use it in GitHub Desktop.
Find the last day of the current month with Dart's DateTime class.
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