26-07-2010, 23:06
|
|
|
|
חבר מתאריך: 17.11.05
הודעות: 5,696
|
|
קוד PHP:
<?php function week($year, $week) { $from = date("Y-m-d", strtotime("{$year}-W{$week}-1")); //Returns the date of monday in week $to = date("Y-m-d", strtotime("{$year}-W{$week}-7")); //Returns the date of sunday in week return "Week {$week} in {$year} is from {$from} to {$to}."; } echo week(2008,27); //Returns: Week 27 in 2008 is from 2008-06-30 to 2008-07-06. ?>
מקור
_____________________________________
|