• Nike free run 2 pink
  • Nike free 5.0 kids
  • Oakley sunglasses discount
  • CodeAve.com CodeAve.com - JavaScript - Document Info
    ASP
    JavaScript
    ·Document Info
    ·Forms
    ·Images
    ·Miscellaneous
    ·Navigation
    ·Script Writers
    ·Contents
    ·What's New?
    CSS
    HTML
    Maps
    Links
    Mail List
    Search
    Sitemap


     

  • Retro 3 jordans
  • Jordan 13 retro
  • Nike free 5.0

  • Current Date with Arrays
  • Air jordan 11 low
  • New Balance 996
  • Ray ban vintage sunglasses
  • Displaying the date and time in JavaScript is as easy as document.write(date());. However, that will return the date and time a format similar to this Sun Dec 17 02:36:01 2000. To display it in a convention other than that requires some basic info in the date values and simple applied logic. JavaScript returns the month value in a range from 0 through 11 and the date in a range from 0 to six. By creating an array for each of those and placing logic to output the year you can easily output the current date similar to the example below.

    Today is

    View the Output
    Text View
    Print View
    Mail this Link
    Download the Code

    <html>
    <title>CodeAve.com(JavaScript: Current Date with Arrays)</title>
    <body bgcolor="#FFFFFF">
    Today is 
    <script language="JavaScript">
    <!-- 
    // Set an array for the days of the week
    // We add a comma and a space to each for presentation
    // get.day will return 0 through 6 as valid values 
    word_day = new Array(
    "Sunday, ",
    "Monday, ",
    "Tuesday, ",
    "Wednesday, ",
    "Thursday, ",
    "Friday, ",
    "Saturday")

    // Set an array for the Months of the year
    // We add a space after the month for presentation
    // get.month will return 0 through 11 as valid values 
    word_month = new Array(
    "January ",
    "February ",
    "March ",
    "April ",
    "May ",
    "June ",
    "July ",
    "August ",
    "September ", 
    "October ",
    "November ",
    "December ")

    // Set right_now to the current date() value
    right_now = new Date();

    // Write the day of the week
    document.write(word_day[right_now.getDay()]);
    // Write the Month of the year
    document.write(word_month[right_now.getMonth()]);

    //Write the date of the month
    document.write(right_now.getDate() + ", ");

    // Write out the Year
    var right_year=right_now.getYear();
    if (right_year < 2000) 
    right_year = right_year + 1900; 
    document.write( right_year );
    -->
    </script>


    </body>
    </html>

     

     

     



    ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
    Server Variables | Response Objects | Random Events | Miscellaneous
    HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
    JavaScript: Document Info | Forms | Images | Navigation | Script Writers
    CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

    jordan 11 gamma Nike KD VI lebron 11 low