NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP / Date help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-05-2008, 11:47 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
w1ww's Avatar
Join Date: Oct 2006
Location: Mars.
Posts: 439
w1ww is a jewel in the roughw1ww is a jewel in the roughw1ww is a jewel in the rough
 



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
__________________
:notme:
w1ww is offline  
Old 07-05-2008, 12:28 PM   #2 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
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(2008274);
????: NamePros.com http://www.namepros.com/programming/489531-php-date-help.html

?>
Eric is offline  
Old 07-05-2008, 12:44 PM THREAD STARTER               #3 (permalink)
NamePros Regular
 
w1ww's Avatar
Join Date: Oct 2006
Location: Mars.
Posts: 439
w1ww is a jewel in the roughw1ww is a jewel in the roughw1ww is a jewel in the rough
 



Many thanks, I will give it a try!
__________________
:notme:
w1ww is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:00 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger