Hi all!
I have a (working) function to get a datestring
out of a given year, week (of year) and day (of month).

function week2date2($year, $week, $day)
{
    $Jan1 = mktime(1,1,1,1,1,$year);
    $offset = (11-date('w',$Jan1))%7-3 + $day;
    $desiredDay = strtotime(($week-1) . ' weeks '.$offset.' days', $Jan1);
    return $desiredDay;
}
I.e 2007,31,4 as arguments returns a date (1186095661)
that is therefter formatted to a datestring: 
date("Y-m-d", $date) returns '2007-08-03' in this example.
My question is, can I rework the week2date2() to take the number
of a month (1-12) instead of the number of a week (1-52), and still
get the same resulting datestring  ???
I have tried a lot of variants, but I am lost on this one!  
Any help is much appreciated.
Regards, /Kris


Reply via email to