Advertisement

02.20.2008 at 05:18PM PST, ID: 23179789
[x]
Attachment Details

Create a date from week number and day number

Asked by snorcha in PHP for Windows, PHP Scripting Language

Tags: PHP, PHP, PHP 5 or PHP 4

Hi experts!

Recently I have been asked to write a function that can create a date from a week number and day number for the 2 previous years.

I can't quite figure it out, i've looked everywhere on the net but no go.

This is what i have so far;

<?php>
//Get the week number and day number
//Current Week Number
$tw=date("W");

//Current Day Number
$td=date("w");

//This Year
$y=date("Y");
//Last year
$ly=$y-1;
//2 Years Ago
$l2y=$y-2;

//Need the day in format yyyy-mm-dd
//Not sure what to do
<?php>

Any help would be greatly appreciated, as I'm pulling out my hair. I've worked with dates and times before in php, but this has me stumped.

Thanks in advanceStart Free Trial
[+][-]02.20.2008 at 06:53PM PST, ID: 20944571

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP for Windows, PHP Scripting Language
Tags: PHP, PHP, PHP 5 or PHP 4
Sign Up Now!
Solution Provided By: switto
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.20.2008 at 08:05PM PST, ID: 20944924

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.20.2008 at 08:12PM PST, ID: 20944948

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628