2

I need to use the month of actual year, something like this

$mid = new DateTime('YYYY-07-01'); // this is where should work the actual year

echo $mid->modify('second monday')->format('Y-m-d');
Cid
  • 14,968
  • 4
  • 30
  • 45
jtqnp
  • 25
  • 2

1 Answers1

3

Call date to get the current year.

$mid = new DateTime(date('Y') . '-07-01');
Dave
  • 5,108
  • 16
  • 30
  • 40