note 44784 modified in function.strtotime by aidan
| From: | aidan@php.net | Date: | Mon, 16 Aug 2004 17:51:00 +0000 |
| Subject: | note 44784 modified in function.strtotime by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79799@lists.php.net to get a copy of this message | ||
the easiest way (i think :) to get a monday from a week's number:
<?php
function getMonday ($kwName)
{
$thisWo = date("W");
$diffWo = $kwName-$thisWo;
$monday = strtotime("this Monday");
$plus_week = "+".$diffWo." week";
$nextMon = date("d.m.y", strtotime($plus_week, $monday));
echo $nextMon;
}
?>
where $kwName - a week's number.
--was--
the easiest way (i think :) to get a monday from a week's number:
function getMonday ($kwName)
{
$thisWo = date("W");
$diffWo = $kwName-$thisWo;
$monday = strtotime("this Monday");
$plus_week = "+".$diffWo." week";
$nextMon = date("d.m.y", strtotime($plus_week, $monday));
echo $nextMon;
}
------------
where $kwName - a week's number.
http://php.net/manual/en/function.strtotime.php