Skip to content

Instantly share code, notes, and snippets.

@remoharsono
Created March 19, 2020 06:25
Show Gist options
  • Save remoharsono/1d3eed27bdca266052ddff5a7cf51136 to your computer and use it in GitHub Desktop.
Save remoharsono/1d3eed27bdca266052ddff5a7cf51136 to your computer and use it in GitHub Desktop.
Get first day and last day of current month
<?php
$start_date_month = new DateTime("first day of this month");
$end_date_month = new DateTime("last day of this month");
echo $start_date_month->format('Y-m-d')."\n";
echo $end_date_month->format('Y-m-d');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment