Hello,
<option value="0"> Sunday </ option>
<option value="1"> Monday </ option>
<option value="2"> Tuesday </ option>
<option value="3"> Wednesday </ option>
<option value="4"> Thursday </ option>
<option value="5"> Friday </ option>
<option value="6"> Saturday </ option>
I want to take the nearest date with the number of week’s day which I gived.
If the number of week is today, and the hour and minute haven’t passed the current time yet, I want to take the date of today.
Can you help me?
I don’t know the code below works for this ???
[php]
$week = 3;
$hour = 23;
$minute = 26;
$second = 00;
$month = date(‘n’);
$day = date(‘j’);
$year = date(‘Y’);
$timestamp = mktime( $hour, $minute, $second, $month, $day, $year ) + ( $week * 7 * 24 * 60 * 60 );
$timestamp_for_monday = $timestamp - 86400 * ( date( 'N', $timestamp ) - 1 );
$date_for_monday = date( 'Y-m-d', $timestamp_for_monday );
[/php]
Best Regards