Reputation: 752
how to get the date of first monday of the current year using php functions
example 04-01-2010
Upvotes: 4
Views: 5581
Reputation: 3559
<?php
// this does NOT work
echo date('Y-m-d', strtotime('first monday of 2010')); // 2018-12-03
// this does work
echo date('Y-m-d', strtotime('first monday of january 2010')); // 2010-01-04
Upvotes: 1
Reputation: 18273
Another possible solution would be:
<?php
echo date("Y-m-d", strtotime("mon jan 2014"));
Upvotes: 2
Reputation: 6113
Just change the format as wanted :)
<php echo date("d m y", strtotime("first monday of 2010")); ?>
Upvotes: 9