what date is it? PHP style

This is a discussion on what date is it? PHP style within the PHP Language forums, part of the PHP Programming Forums category; I am making a little PHP timetable for myself but the rooms change every week, so I'm storing the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-01-2007
James54321
 
Posts: n/a
Default what date is it? PHP style

I am making a little PHP timetable for myself but the rooms change
every week, so I'm storing the dates of each week number (they're
numbered 1 - 52). If there is any way of getting the sytem to count
the weeks for me so I don't have to enter the dates of each week that
would be greatly appreciated. The main thing I need is to be able to
get the php script to recognise which week it is in and display the
appropriate rooms - but I have never worked with dates at such a level
and so I'm not sure how to that. I will also allow the user to select
which week to look at (after displaying the current week) via a drop
down box (that ONLY displays weeks that have not passed) - so any tips
on that would be greatly appreciated too.

Thanks in advance, James.

Reply With Quote
  #2 (permalink)  
Old 11-01-2007
Captain Paralytic
 
Posts: n/a
Default Re: what date is it? PHP style

On 1 Nov, 12:49, James54321 <webmas...@jstokell.co.uk> wrote:
> I am making a little PHP timetable for myself but the rooms change
> every week, so I'm storing the dates of each week number (they're
> numbered 1 - 52). If there is any way of getting the sytem to count
> the weeks for me so I don't have to enter the dates of each week that
> would be greatly appreciated. The main thing I need is to be able to
> get the php script to recognise which week it is in and display the
> appropriate rooms - but I have never worked with dates at such a level
> and so I'm not sure how to that. I will also allow the user to select
> which week to look at (after displaying the current week) via a drop
> down box (that ONLY displays weeks that have not passed) - so any tips
> on that would be greatly appreciated too.
>
> Thanks in advance, James.


Now when I have a question like "Can I get php to tell me what week it
is?", my first thought is to look at the manual. My thought process
would have me search the manual for "week number" and then, seeing as
his has to do with dates, I would search the manual to see whether
there are any suitable date functions.

My advice is to try this yourself in future. You will learn a lot more
if you use the manuals, than just by asking someone else for the
answers all the time.

http://uk.php.net/manual/en/


Reply With Quote
  #3 (permalink)  
Old 11-01-2007
Michael Fesser
 
Posts: n/a
Default Re: what date is it? PHP style

..oO(James54321)

>I am making a little PHP timetable for myself but the rooms change
>every week, so I'm storing the dates of each week number (they're
>numbered 1 - 52). If there is any way of getting the sytem to count
>the weeks for me so I don't have to enter the dates of each week that
>would be greatly appreciated. The main thing I need is to be able to
>get the php script to recognise which week it is in and display the
>appropriate rooms - but I have never worked with dates at such a level
>and so I'm not sure how to that.


Check the parameters of strftime() or date().

Also note that some years have 53 weeks.

Micha
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:39 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0