Need a new web host or having a problem with a script? Tips and advice on the best way to design, build and maintain your most valuable asset - your website!

Automatic date stamp

sasha
Posts: 8
Joined: 07 Jan 07
Trust:

Automatic date stamp

Hi,

How can I make the date on my website to change daily so I don't have to do it manually?

Thanks!!

Slavenska
  • 0
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
You can try this on a page that is .php

Insert this into your page... set the +3 to whatever you like. This is for a numerical date.

<?php
$tomorrow = mktime(0, 0, 0, date("m"), date("d")+3, date("y"));
echo "Order By ".date("m/d/y", $tomorrow);
?>
  • 0
sasha
Posts: 8
Joined: 07 Jan 07
Trust:
adrian wrote:You can try this on a page that is .php

Insert this into your page... set the +3 to whatever you like. This is for a numerical date.

<?php
$tomorrow = mktime(0, 0, 0, date("m"), date("d")+3, date("y"));
echo "Order By ".date("m/d/y", $tomorrow);
?>


Thanks Adrian! I will try it.

Slavenska
  • 0
PremiumMember
cdidcott
Posts: 79
Joined: 23 Aug 06
Trust:
adrian wrote:You can try this on a page that is .php

Insert this into your page... set the +3 to whatever you like. This is for a numerical date.

<?php
$tomorrow = mktime(0, 0, 0, date("m"), date("d")+3, date("y"));
echo "Order By ".date("m/d/y", $tomorrow);
?>


Is it an easy process to change a page from .html to .php?

How about a Date for non-php pages?

Colin
  • 0
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
cdidcott wrote:
adrian wrote:You can try this on a page that is .php

Insert this into your page... set the +3 to whatever you like. This is for a numerical date.

<?php
$tomorrow = mktime(0, 0, 0, date("m"), date("d")+3, date("y"));
echo "Order By ".date("m/d/y", $tomorrow);
?>


Is it an easy process to change a page from .html to .php?

How about a Date for non-php pages?

Colin


Sure is Colin! All you have to do is.......... are you ready?

Change the .html to .php and your are done! Voila!

As for a html script.... I would have to look for one.
  • 0
stevenar
Posts: 63
Joined: 18 Apr 07
Trust:
You can change the date with javascript too. Found this on the net.. it has a bunch of clock and date scripts. You can pick the one you like most.

http://www.java-scripts.net/javascripts ... ript.phtml
  • 0
PremiumMember
cdidcott
Posts: 79
Joined: 23 Aug 06
Trust:
Thanks for the link stevenar, I'll check it out now.

Thanks Adrian for the advice :) (I'm learing every day)

Colin
  • 0
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
cdidcott wrote:Thanks Adrian for the advice :) (I'm learing every day)

Colin


:D
  • 0