how to make an auto date update

i want to know how can i make the date change itself in (on your left) News & Events.

In addition, i need a code that will allow customers to send mail on this page :

Name - Email - Message, i just need the code that will allow to get mails when submit the form.

Thank you alot
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

To make a date change itself on a web page, you need to refresh the page.  I.E. use javascript to get the current date and time when the page initially loads.  That is fine, but will remain static until you reload the page.  To automatically make the page refresh, you need to add this code to the HEAD of the HTML page --


That reloads a page every 5 minutes (5 times 60 seconds.).  You can also do this in javascript if interested.
The simple javascript make this possible.
put scri[t in head section of your html and

 "<DIV id="clock" style="FONT-SIZE: 15px;"></DIV>"
where you want to show your watch

<SCRIPT language=javaScript>
onload = function() {
	thistime= new Date()
	var hours=thistime.getHours()
	var minutes=thistime.getMinutes()
	var seconds=thistime.getSeconds()
	if (eval(hours) <10) {hours="0"+hours}
	if (eval(minutes) < 10) {minutes="0"+minutes}
	if (seconds < 10) {seconds="0"+seconds}
	thistime = hours+":"+minutes+":"+seconds
	var timer=setTimeout("clockon()",200)

Open in new window

l1rz1mAuthor Commented:
Thank you all for your solutions, i think you didn't understand what i wanted exactly, so let me explain it :

In the page of Index.html you can see the section of News & Events, before, i had to edit the page manually and edit the date for exemple if today is 24/04/2010 i have to download the page and open it with FrontPage and edit the date to 25/04/2010 and so on upload it again for update the News & Events,

Now i want this date which is 24/04/2010 change itself from 24/04/2010 to 25/04/2010 automatically, no need to do it manually, you got me now? any idea?

Thank you
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

YES.  Put exactly THIS at the place in the page where you want the current date to appear --

<SCRIPT language="javascript">timeDate()</script>
 <!--#config timefmt="%a %d %b %Y -- %I:%M %p" --><!--#echo var="DATE_LOCAL" -->

Then in the HEAD of the page, put this JAVASCRIPT -- after the <HEAD> tag and before </HEAD> tag --

<SCRIPT language="javascript">
function timeDate() {
var today = new Date();
var day   = today.getDay();
var date  = today.getDate();
var month = today.getMonth() + 1;
var year  = today.getFullYear();
var mins = today.getMinutes();
var hours = today.getHours();
   if (mins < 10) mins = '0' + mins;
   if (hours < 12)  {mins = mins + "am";}
   if (hours == 12)  {mins = mins + "pm";}
   if (hours > 12)  {hours = hours-12; mins = mins + "pm";}
document.write(hours +":" + mins + ", " + d[day] + ' ' + date + ' ' + m[month-1] + ' ' + year);

Do that EXACTLY and it will work.  I have had it working on my site for 5 years !!
It gives the date and time.
l1rz1mAuthor Commented:
I tried this solution but it didn't work, there must be a mistake that i have done, please check the source code  of the page 
Thank you
Move the script I gave above, to the bottom of the <HEAD> section -- put it after all the CSS, and just a line before the closing </HEAD> tag.  See if that helps.  All METAs should come before CSS and javascript.

This line I gave you --
 <!--#config timefmt="%a %d %b %Y -- %I:%M %p" --><!--#echo var="DATE_LOCAL" -->
change it to --

 #config timefmt="%a %d %b %Y -- %I:%M %p"  #echo var="DATE_LOCAL"

If server side includes are enabled on your webserver, that will give the local date and time where the server is located.  See if that works.

Do you have javascript disabled in your browser?  Mine (same code as I gave you) works for me.  Maybe enclose this in a <FONT> tag to make sure it is visible and not hidden.
l1rz1mAuthor Commented:
I did what you said, check this page to see what it shows :

Please help.

Thank you
Well SSI is not enabled on your web server.  I guess that won't work, but the javascript should work.
l1rz1mAuthor Commented:
so any idea please?
The javascript I gave you should have worked.  Maybe there is something on your site that is blocking it.  How often do you need to update the date?
l1rz1mAuthor Commented:
the date in News & events must be changed daily with a new date. is there any code with php for exemple?
It is fairly simple with PHP:

print strftime('%c');


Wed Apr 28 01:22:58 2010

You need to pass format such as %c to strftime() to print date and time representation for the current system. You can use following format characters:

    * %m - month as a decimal number (range 01 to 12)
    * %d - day of the month as a decimal number (range 01 to 31)
    * %Y - year as a decimal number including the century
    * You can see the complete format conversion specifiers online here

You can also use date() as follows:

 print date('r');
 print "\\n";
 print date('D, d M Y H:i:s T');
 print "\\n";


Wed, 28 Apr 2010 01:29:56 +0530
Wed, 28 Apr 2010 01:35:14 IST

You need to pass r format conversion to print formatted date. See the complete format conversion specifiers online here

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James MurrellProduct SpecialistCommented:
any you using PHP:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.