Results 1 to 6 of 6

Thread: How to add live date without time clock?

  1. #1
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to add live date without time clock?

    I am trying to incorporate each day's current date into my work email without having to manually insert the date on each message.

    I have seen scripts for date and time, but I just want the day of the week and the calendar date. IE -> December 27, 2007

    Suggestions on that please?

    Chris


  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there ctmom05,

    and a warm welcome to these forums.

    Try this, it is pretty basic...
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>date only</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <style type="text/css">
    
    body {
         background-color:#003;
         color:#fff;
     }
    #container {
         text-align:center;
         margin-top:40px;
     }
    #date {
         font-family:verdana,arial,helvetica,sans-serif;
         font-size:20px;
         color:#fff;
         text-align:center; 
         background-color:#003;
         border:0 solid;
         width:190px;
    }
    
    </style>
    
    <script type="text/javascript">
    
    window.onload=function(){
       now=new Date().toDateString();
       document.getElementById('date').value=now;
    }
    
    </script>
    
    </head>
    <body>
    
    <div id="container">
    <input id="date" type="text">
    </div>
    
    </body>
    </html>
    
    
    coothead

  3. #3
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Now we're getting somewhere. All I have to do is change a couple of very minor things; hopefully I can figure those things out<grin>

    Thanks Coot!

  4. #4
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    No problem, you're welcome.

  5. #5
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default this one's a tough nut to crack

    Ok Coot.....come on back and help me some more - please.

    I thought I had this thing down pat. I was practicing on an HTML editor site and got the date, just the way I wanted; in the right place too.

    The problem is that somehow I cannot transfer what I have done to where I need it. I use a web-based email program at work and wanted to incorporate this date function into my work emails.

    Any idea on what the next step should be?

  6. #6
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there ctmom05,
    I use a web-based email program at work and wanted to incorporate this date function into my work emails.
    Ah, emails.
    You may well have a problem there.
    I have Outlook Express on my pc and it does not accept javascript a.f.a.i.k.
    There may well be a block on other email programs also.
    You really need to check with your administrator about this.

    coothead

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
  •