473,800 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ 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 1287
On 1 Nov, 12:49, James54321 <webmas...@jsto kell.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
13270
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 am expecting. Can anyone help please TIA Steve PS I'm new to javascript
4
2526
by: pete | last post by:
I found it in the view source of a corporate website. <script Language="Javascript"> <!-- var keyMacro= ]; //--> </script>
9
2250
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 at http://webfx.eae.net but it does not seem to be free. Thanks!
12
29474
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 follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
3
3318
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 the field should only be showing one or the other (date or time). Even on the back end of the database where the column properties are, I have chosen the smallest date/time formats. When the aspx page runs, it shows the date and time (ie:in a...
3
4496
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 that will do this? Also, how can I add a button to a form to enter a NULL. Thanks in advance.
3
1727
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 little stumped with the date object. how does it read the values from the month select list and the year select list in the html? <SCRIPT LANGUAGE="JavaScript">
1
1192
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 name="frmPrint" action="printstocksheet.php"> <table width="100%" border="0" align="center">
1
3849
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 worked. Dates of particular year,month not displayed in that calender grids. i have collected that coding from online free resources. Here i have attached code for your reference. please do suggest me how do i display the calender date in grids in...
9
3544
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 this happens. This is my part of code given below. <%@ Language=VBScript%> <%Option Explicit%> <html> <head> <title>SABF</title> <!--#include file="font.css"-->
0
9691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10279
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10036
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5473
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
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 we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.