Need a Date Script (Simple)

Discussion in 'JavaScript' started by Daniel591992, Aug 28, 2007.

  1. #1
    Hey, can someone make or link me to a script that can display the date in this format:

    Tuesday, June 8


    Thanks in advance
     
    Daniel591992, Aug 28, 2007 IP
  2. temp2

    temp2 Well-Known Member

    Messages:
    1,231
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    150
    Digital Goods:
    2
    #2
    Demo: http://javascriptbank.com/javascript/time---simple-current-date-script-javascript.html

    
    <SCRIPT LANGUAGE="JavaScript1.2">
    var months=new Array(13);
    months[1]="January";
    months[2]="February";
    months[3]="March";
    months[4]="April";
    months[5]="May";
    months[6]="June";
    months[7]="July";
    months[8]="August";
    months[9]="September";
    months[10]="October";
    months[11]="November";
    months[12]="December";
    var time=new Date();
    var lmonth=months[time.getMonth() + 1];
    var date=time.getDat
    f9
    e();
    var year=time.getYear();
    if (year < 2000)    // Y2K Fix, Isaac Powell
    year = year + 1900;
    document.write("<center>" + lmonth + " ");
    document.write(date + ", " + year + "</center>");
    
    </script>
    
    Code (markup):
     
    temp2, Sep 8, 2007 IP