Results 1 to 4 of 4

Thread: Date script needed

  1. #1
    Join Date
    Sep 2010
    Location
    California
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Date script needed

    Hi, I need a simple javascript thingy that shows just the date in the format: OCT 11
    The day number needs to be able to be separated by a <br/> tag from the month abbreviation.

    Thanks for the help!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Try this as a place to start:
    http://www.mediacollege.com/internet...ipt/date-time/


    Found by searching for "javascript show date" on google-- please at least try a search before posting for help.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Sep 2010
    Location
    California
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Sorry about that. My mom has WebWatcher on my computer, and Google is disabled. I can only visit certain websites, and this is one of them.

    Thanks anyways!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You'll need access to many different sites to become a successful designer. Of course you will have to work that out as you can. But until then, it's extra work if we can't help you by providing links or you can't look these things up yourself.

    But for the moment, here's the code from that page. You should be able to modify it as required.
    Code:
    //http://www.mediacollege.com/internet/javascript/date-time/
    //To use the Date/Month/Year format ( e.g. 2 February 2011 ):
    
    <script type="text/javascript"><!--
    function makeArray() {
    for (i = 0; i<makeArray.arguments.length; i++)
    this[i + 1] = makeArray.arguments[i];
    }
    
    var months = new makeArray('January','February','March','April','May',
    'June','July','August','September','October','November','December');
    var date = new Date();
    var day = date.getDate();
    var month = date.getMonth() + 1;
    var yy = date.getYear();
    var year = (yy < 1000) ? yy + 1900 : yy;
    
    document.write(day + " " + months[month] + " " + year);
    //--></script>
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •