Results 1 to 3 of 3

Thread: Date Script

  1. #1
    Join Date
    Apr 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Date Script

    Complete novice here, i want a script to display the current date in the format: November 5, 2004


    I have seen the script here: http://www.dynamicdrive.com/dynamicindex6/clock3.htm

    but my attempts to edit it have all failed...

    any kind fellow that can lend a hand would be a real stress-aid

    tom

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Did you only want to display the current date and not the time as well? If so a script like this will do: http://www.javascriptkit.com/script/cut164.shtml

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Floppyarms
    Complete novice here, i want a script to display the current date in the format: November 5, 2004
    Code:
    (function() {
      var now    = new Date(),
          months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
    
      document.write([
        months[now.getMonth()], ' ',
        now.getDate(), ', ',
        now.getFullYear()
      ].join(''));
    })();
    Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •