S
S
sawa42016-08-05 08:07:25
PHP
sawa4, 2016-08-05 08:07:25

How to determine the date if you know the year, month, day of the week?

How to determine the specific date of the month, knowing the month, year and day of the week.
For example: 2016, August, Monday.
How to get the date of the first Monday in August?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-08-05
Protko @Fesor

echo (new DateTime($year . '-' . $month))
      ->modify('first ' . $day ' . of this month') // first monday of this month
      ->format(\DateTime::ATOM);

S
sawa4, 2016-08-05
@sawa4

Thank you!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question