473,464 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.

Nov 1 '07 #1
2 1279
On 1 Nov, 12:49, James54321 <webmas...@jstokell.co.ukwrote:
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/
Nov 1 '07 #2
..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
Nov 1 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Steve Wright | last post by:
I am trying to validate if an entry on a form is a date. I have adapted code I found here http://www.codingforums.com/archive/index.php/t-14325 as below but I can't seem the get the results that I...
4
by: pete | last post by:
I found it in the view source of a corporate website. <script Language="Javascript"> <!-- var keyMacro= ]; //--> </script>
9
by: newtophp2000 | last post by:
I need to add the ability for the users to select a date on one of our web pages. The examples I was given by some users were in JavaScript. Is there a free date picker that I can use? I saw one...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
3
by: Bob Sanderson | last post by:
I have a PHP web page which uses a HTML form. I would like to enter dates into the date fields using a JavaScript calendar, similar to the way phpMyAdmin does. Can anyone recommend a JavaScript...
3
by: ballygowanboy | last post by:
hi, i've a basic credit card info form, checks name, card type and if number is valid...... i got these working ok here's the code i have so far. i'm trying to make a function, getdate(), but am a...
1
by: gnawz | last post by:
The SQL statements are not working. It returns a page with only titles and no database results.. First file <? require_once '../../functions.php'; ?> Select category to print <hr> <form...
1
by: xtremebass | last post by:
Hello Bytes, i have a calender program which is created by using Javascript. when i execute that program using Internet Explorer,it works properly but when i tried in Mozilla firefox it didnt...
9
vikas251074
by: vikas251074 | last post by:
I am not getting date value in spite of my good effort. This code was working in my last office where I work. Now I am trying to work at my home pc. but not getting date value. Any can help me why...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.