Skip to content

Instantly share code, notes, and snippets.

@shadyueh
Created July 4, 2022 19:47
Show Gist options
  • Save shadyueh/93f8ae40ea568defb5c1042d740be135 to your computer and use it in GitHub Desktop.
Save shadyueh/93f8ae40ea568defb5c1042d740be135 to your computer and use it in GitHub Desktop.
<?php
$date = new DateTime('now');
$date->modify('first day of this month');
echo $date->format('Y-m-d');
$date->modify('last day of this 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