F
F
ff0xff2019-08-05 11:22:24
PHP
ff0xff, 2019-08-05 11:22:24

How to get the number of the first Tuesday of the current month?

I have the current month, I need to get the date of the first Tuesday of this month.
How to do it in php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lander, 2019-08-05
@ff0xff

echo date('d.m.Y', strtotime("first tuesday of this month"));

Although kosher:
echo (new \DateTime("first tuesday of this month"))->format('Y-m-d');

I
irishmann, 2019-08-05
@irishmann

<?php
    $first_tuesday = date("d.m.Y", strtotime('first tuesday of this month'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question