1WiseOwl Blog|Trusted ways to help make your first dollar online

Home
About
Archives
Sitemap

Subscribe to my Newsletter

Your information is private and will never be shared with anyone. I respect your privacy and hate SPAM with a passion

More FREE Stuff

- Atomic Blogging Leak Copy
- Blogging Videos
- Go To Our Money Making Resource Blog

Apr

15

How to code your site to display the current date

Filed Under (Tips) by Ken Scovill on 15-04-2008

I see this question come up quite a bit in the forums, so I thought I would post the answer here for folks to use.

There are a couple of different ways that you can place an autodate script in your website code, with javascript or php coding.You can use a few lines of JavaScript which picks up the date information from the visitor’s computer and displays it on the web page. Here’s the full javascript version if you want to copy it:<script language=”JavaScript”>
<!–
var days=new Array(8);
days[1] = “Sun”;
days[2] = “Mon”;
days[3] = “Tue”;
days[4] = “Wed”;
days[5] = “Thu”;
days[6] = “Fri”;
days[7] = “Sat”;
var months=new Array(13);
months[1] = “Jan”;
months[2] = “Feb”;
months[3] = “Mar”;
months[4] = “Apr”;
months[5] = “May”;
months[6] = “Jun”;
months[7] = “Jul”;
months[8]= “Aug”;
months[9] = “Sep”;
months[10] = “Oct”;
months[11] = “Nov”;
months[12] = “Dec”;
var dateObj=new Date()
var wday=days[dateObj.getDay() + 1]
var lmonth=months[dateObj.getMonth() + 1]
var date=dateObj.getDate()
var year=dateObj.getYear()
if (year >= 100 && year <= 1999)
{year=year + 1900}
else
{year=year}
document.write(wday + “, ” + date+ ” ” + lmonth + ” ” + year)
// –>
</script>

If you want to put in the full word for “Mon” or “Jan”, you just need to change the wording in the script. Just place this script in where the ‘date’ would normally show up.

Add this to : Digg! Digg it Bookmark! Save to Del.icio.us Subscribe to RSS Subscribe to My RSS feed
Do You Have Something To Say? What Do You Think?
Add Your Comment
  • Full Feed RSSFull Feed RSS
  • CommentsComments


  • Categories

    • Make Money Online
    • Purpose
    • Tips
  • Archives

    • May 2009
    • April 2008
    • March 2008
  • My Sites

    • 1WiseOwl Ebooks
    • Affiliate Cash Secrets
    • Push Button Income
  • Pages

    • About
    • Archives
    • Sitemap

Categories

Make Money Online
Purpose
Tips

Recommended Moneymakers

  • Make Money Blogging
  • Make Money Online
  • FREE Autoresponder
  • FREE Blogging Videos
  • Reliable Hosting

Recent Readers

Blogroll

  • Affiliate Cash Secrets
  • Push Button Income
  • 1WiseOwl Ebooks
Copyright © 2007 Make Money Online with GatherSuccess
askgraphics