Fork me on GitHub

Need Javascript Date Change  Bottom

  • I could use a little help with changing the date format on a theme. The theme uses a little javascript to enter the date and the date reads 29. May 2004 and I want it to read May 29, 2004. I don't know javascript at all so I hope someone will be willing to help me on this. The present code for the date is:

    Code

    <P ALIGN=RIGHT><B><script type="text/javascript">
    <!--   // Array ofmonth Names
    var monthNames = new array( "January","February","March","April","May","June","July","August","September","October","November","December")
    var now = new date();
    thisYear = now.getYear();
    if(thisYear < 2004) {thisYear += 2004}; // corrections if Y2K display problem
    document.write(now.getdate() + ". " + monthNames[now.getMonth()] + " " + thisYear);
    // -->
    </script>&nbsp; </B></P>


    Any help would be appreciated.

    Thank you,
  • Have a look at this information:

    http://members.ozemail.com.au/~dcrombie/javascript/chap09.html

    Hope this helps,

    Kindest regards
    Lobos

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • I did it for you ;) Just use the code below (it's time I started playing a bit more with javascipt.

    Code

    <script type="text/javascript">
    <!--   // Array ofmonth Names
    var monthNames = new array( "January","February","March","April","May","June","July","August","September","October","November","December")
    var now = new date();
    thisYear = now.getYear();
    if(thisYear < 2004) {thisYear += 2004}; // corrections if Y2K display problem
    document.write(monthNames[now.getMonth()] + " " + now.getdate() + ", " + thisYear);
    // -->
    </script>


    Your welcome, kindest regards,

    Lobos

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • Thanks Lobos! I'll tuck that bit O code away too - it will come in handy.
  • Yeps thanks Lobos I was in the market as well looking for something like this :)
  • Lobos

    I did it for you ;) Just use the code below (it's time I started playing a bit more with javascipt.

    Code

    <script type="text/javascript">
    <!--   // Array ofmonth Names
    var monthNames = new array( "January","February","March","April","May","June","July","August","September","October","November","December")
    var now = new date();
    thisYear = now.getYear();
    if(thisYear < 2004) {thisYear += 2004}; // corrections if Y2K display problem
    document.write(monthNames[now.getMonth()] + " " + now.getdate() + ", " + thisYear);
    // -->



    </script>


    Your welcome, kindest regards,

    Lobos


    Oh goodness! Thank you so much and so sorry I took so long to answer! Have been totally involved in moving myself to a new server and haven't been back here until now. I really appreciate your help! You are awesome!
  • 0 users

This list is based on users active over the last 60 minutes.