Page 1 of 1

[solved] Date Problem

Posted: Fri Sep 16, 2005 5:06 am
by waqas_punjabian
hi,

Problem:

How can i get dates of every week starting from saturday

Ther would be 2 pull down menus. 1) for years 2) for week dates starting from saturday.

I need the ability to change this menu, for example for 2007. 2008, etc.

june 5th
june 12th
june 19th
june 26th

July 3
July 10th
July 17th
July 24, etc

-------------------------------------------------------------------------------------

Kindly, help me how can i do that or, can i get the code for that, or how can i start working on that ?
Thanks in Advance.

Posted: Fri Sep 16, 2005 7:32 am
by feyd
strtotime() is probably the fastest way to get 1 correct date. If you get the first saturday of a year, you can add 7 days to it until it wraps around to a new year.....

Code: Select all

[feyd@home]>php -r "echo(date('Y-m-d D',strtotime('this saturday',mktime(0,0,0,1,1,2005))));"
2005-01-01 Sat
[feyd@home]>php -r "echo(date('Y-m-d D',strtotime('this saturday',mktime(0,0,0,1,1,2004))));"
2004-01-03 Sat

Posted: Fri Sep 23, 2005 11:01 am
by waqas_punjabian
hey

thanks buddy,

it 've been solved

regards

WAQAS