Home Trading Cards & Memorabilia Forum

(OT) - Web site question

Hey Everyone,

I need some help with my website. I would like to add the date, such as Wednesday, April 10th 2007 or something similar to my homepage. I would like it to automatically update each day so I don't have to manually do it.

Does anyone know of a simple program for such a thing? Thanks in advance for any help.

Jim

Currency Wants: Any note with serial number 00000731

Comments

  • Insert into <Body>

    <SCRIPT>
    document.write(Date()+".")
    </SCRIPT>
  • Brian48Brian48 Posts: 2,624 ✭✭✭
    Javascript is easy to implement for this type of thing.



    << <i>

    <script language="JavaScript">

    var sMonth = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');

    function getDate(dNow) {
    // Date
    sDate = sMonth[(new Date()).getMonth()] + ' ' + dNow.getDate() + ', ';
    if(dNow.getYear() < 100) sDate += '19';
    sDate += dNow.getYear();
    return(sDate);
    }

    </script>

    >>

  • Brian48Brian48 Posts: 2,624 ✭✭✭
    Specifically, dump the piece of code I posted above towards the top after your HEAD tag.

    Then, anywhere that you want the text to appear, paste this script. You can edit to your tastes and style later.



    << <i>


    <font size=-1 color="#008000">Current date:</font>

    <FONT FACE=ARIAL SIZE=-1 COLOR="#008000"><B><script language="JavaScript">document.write(getDate(new Date())); </script></B></font></TD>

    >>

Sign In or Register to comment.