McNavy McNavy - 2 months ago 21
PHP Question

Current date - Go to next Thursday - PHP

This is my code for get the current date in french (I'm french) and the current time :

<?php

setlocale (LC_TIME, 'fr_FR.utf8','fra');

// FIX date & time email
$date_line = strftime("%A %d %B");
$time_line = date('H:i:s');

?>


With this result, I want to find a method for : How to get date of the Thursday since the current date please?

Answer

Just use a relative date format. In this case 'next Thursday'. Here's a basic example:

$time_line = date('Y-m-d', strtotime('next Thursday'));

Demo