date format

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • omjo
    Corporal

    • May 2007
    • 10

    date format

    Hi,

    how do i insert date in the screen to by updated automatically. this so my visitors can see what date it is today.

    JOhan
  • Collectors-info
    General

    • Feb 2006
    • 8703

    #2
    Re: date format

    Hi, try poping this script into an html box & press preview.


    HTML Code:
    <SCRIPT>
    var mydate=new Date()
    var theYear=mydate.getFullYear()
    var day=mydate.getDay()
    var month=mydate.getMonth()
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
    var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
    document.write(dayarray[day]+", "+montharray[month]+" "+daym+", "+theYear)
    </SCRIPT>
    Regards Chris.

    Collectables, Collecting, collectors-info.com

    www.chrismorris.co.uk

    House build project

    Comment

    • Stevo
      Second Lieutenant

      • Dec 2007
      • 102

      #3
      Re: date format

      I'd like to use an auto date in a form field. Example: 1/25/08

      Any suggestions?

      Thanks.
      Steve

      Comment

      Working...
      X