|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Get current week..
I have an events calendar.. if there's an event on a particular date , that date gets highlighted on the calendar and when the user clicks it...it load the event for that day...
is there an easy way for showing all events for that week? ...so with a know date (could be any day of the week) I want to display all the events happening starting the Sunday before it to the Sunday after it... to display the contents of the entire month is easy enough since I know the month I'm on for that event...simple query at that point. but not sure if there's a built in mechanism to know what week of the month I'm on to be able to dump that in my query thanks |
|
#2
|
||||
|
||||
|
You could use
Code:
date("N", timestamp)
1 = Monday, 2 = Tuesday, etc.. 7 = Sunday. After you got that number, I'm sure you know how to get the last Sunday of the given date.
__________________
Hermawan Haryanto Web Consultant |
|
#3
|
|||
|
|||
|
bingo...that was easy.... thanks!
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Get current week.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|