Skip to content

Instantly share code, notes, and snippets.

@midnai
Last active February 8, 2018 06:26
Show Gist options
  • Save midnai/9e243205d538735d851d05df1af09220 to your computer and use it in GitHub Desktop.
Save midnai/9e243205d538735d851d05df1af09220 to your computer and use it in GitHub Desktop.
last day of the month from date
$date = new DateTime('now');
$date->modify('last day of this month');
echo $date->format('Y-m-d');
$date->modify('last day of 1 month');
echo $date->format('Y-m-d');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment