Determine The First Day Of Week And The First Day Of Month

1. Determine the first day of week (Monday)













To find Monday of next week, we change 'last' to 'next'.
To determine the distance of current day with the first day of week, we use function:
<?php
echo floor((strtotime ("now")- strtotime("last Monday"))/86400);
?>
2. Determine the first day of month
<?php
$day = date('Y-m-d', strtotime(date('Y-m-01', strtotime("now"))));
return $day;
?>

Or:
<?php
$date = date("01/m/Y");
echo $date;
?>
Good luck!

Share this

Related Posts

Previous
Next Post »