 |
Results from the most recent live auction are here.
22 members in the live chat room. Join Chat!
| |
07-05-2008, 10:47 AM
|
· #1 | | NamePros Regular Name: Tiago Location: Mars. Join Date: Oct 2006
Posts: 425
NP$: 79.60 ( Donate)
| PHP / Date help Hello,
Imagine that I want to know what will be the date on the Thursday of week #27 of an year?
For example, now is week #27, year 2008 and the date on Thursday was 03-07-2008 (dd-mm-yyyy).
How can I do that?
Thanks in advance,
Tiago
__________________ |
| |
07-05-2008, 11:28 AM
|
· #2 | | while ($awake){ code(); } Name: Eric Location: Kentucky Join Date: Mar 2005
Posts: 4,239
NP$: 384.00 ( Donate)
| PHP Code: <?php
function week($year, $week, $day)
{
/**
* Day is the # of the day, ex:
*
* 1 - Monday
* 2 - Tuesday
* 3 - Wednesday
* 4 - Thursday
* 5 - Friday
* 6 - Saturday
* 7 - Sunday
*/
return date('m/d/Y', strtotime("$year-W$week-$day"));
}
// returns: 07/03/2008
echo week(2008, 27, 4);
?> |
| |
07-05-2008, 11:44 AM
|
· #3 | | NamePros Regular Name: Tiago Location: Mars. Join Date: Oct 2006
Posts: 425
NP$: 79.60 ( Donate)
| Many thanks, I will give it a try!
__________________ |
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |