August
|------------------------|--------------------------|---------------------------|
M T W T F S S M T W T F S S M T W T F S S M
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Date Time Item
07/08/06 13.00 1
08/08/06 14.00 2
14/08/06 15.00 3
15/08/06 14.00 4
16/08/06 13.00 5
17/08/06 14.00 6
18/08/06 13.00 7
19/08/06 14.00 8
21/08/06 13.00 9
How can I code in such a way that if the date is 21 Aug at 12.45, I would like to get all the item that falls on that week from 14 Aug 13.01 to 21 Aug 13.00 ??
if the date is 22 Aug at 15.00, i would like to get all the item that falls on the week from 21 aug 13.01 to 28 Aug 13.00.
function getweek($dbdate, $dbtime, $todaydate, $todaytime){
// return true if database date falls on the range
}
Return true if date falls on particular week.
Moderator: General Moderators
For a given timestamp date('W') returns the year-of-week. (edit: eh, week-of year)
http://de2.php.net/date
http://de2.php.net/date
Last edited by volka on Mon Sep 04, 2006 7:59 pm, edited 1 time in total.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Maybe look at getting week numbers from date(), then using that somehow to create your week date range.