NYCPHP Meetup

NYPHP.org

[nycphp-talk] Week # and Corresponding Start and End Dates

Chris Bielanski Cbielanski at inta.org
Fri Apr 16 14:33:49 EDT 2004


Jon, I think the questioner wants an inverse of that function  - given a
numeric week of the year (and the year), return the numeric weekdays
contained within. I looked around and MCAL doesn't do it (can't get MCAL for
wind0ze anyway). I believe Java has a function for this, but I don't know
its source offhand.
 
However, restructuring the code such that the dates are returned via DB
query and programatically organized by their weeks using date() seems to be
the way to go, IMHO.
Thanks, 
Chris Bielanski 
Web Programmer, 
International Trademark Association, 
1133 Avenue of the Americas, 33rd Floor 
New York, NY 10036 
+1 (212) 642-1745, f: +1 (212) 768-7796 
mailto:cbielanski at inta.org <mailto:cbielanski at inta.org> , www.inta.org  
INTA -- 125 Years of Excellence 

-----Original Message-----
From: jon baer [mailto:jonbaer at jonbaer.net]
Sent: Friday, April 16, 2004 2:20 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Week # and Corresponding Start and End Dates


I beleive you can test the week with "W" in date, so you would do something
like:
 
$week = date("W", $mydate);
 
- Jon

----- Original Message ----- 
From: invisiblemute <mailto:geek at invisiblemute.com>  
To: talk at lists.nyphp.org <mailto:talk at lists.nyphp.org>  
Sent: Friday, April 16, 2004 1:59 PM
Subject: [nycphp-talk] Week # and Corresponding Start and End Dates

I have a list of date entries in a DB and I am able to pull them out nicely
by week with MySQL. I can't seem to find if there is then a good solution
with MySQL, PHP or some combination of the two for me to display the results
like this:
Week 1 (Jan 1 - 7, 04)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20040416/c14d8c6a/attachment.html>


More information about the talk mailing list