Last active
February 8, 2018 06:26
-
-
Save midnai/9e243205d538735d851d05df1af09220 to your computer and use it in GitHub Desktop.
last day of the month from date
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
$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