Need date and time script for sales page

by 15 replies
17
I'm looking for a date and time script that I can load onto my sales pages so that it looks like this...........



From The Desk Of:
Thrusday, October 2, 2008
7:59am


Does anyone have one......


Thanks
txmom64
#programming #date #page #sales #script #time
  • Hi Texasmom,

    Here is a simple one.

    Code:
    <script type="text/javascript">
    
    var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
    var months = ['January','February','March','April','May','June','July','August','September','October','November','December']
    
    var current = new Date();
    
    document.write(days[current.getDay()] + ", " + months[current.getMonth()] + current.getDate() + ", " + current.getFullYear());
    </script>
    Just put that script where you want the date to appear
  • was there anything that was suppose to in the white box under the word (code
  • Yes, do you see the code now? I just updated it.

    Made the code a bit smaller.
  • It's not working......its showing just was i copied into the html code when i preview it.
  • Where are you uploading it? Can I see it?

    The version up there right now works. I just tested it.
  • i'm creating my page in frontpage.......here's what it looks like on my preview:


    <script type="text/javascript"> var days = new Array(7); var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday' ,'Friday','Saturday'] var months = ['January','February','March','April','May','June', 'July','August','September','October','November',' December'] var current = new Date(); document.write(days[current.getDay()] + ", " + months[current.getMonth()] + current.getDate() + ", " + current.getFullYear()); </script> </SPAN></B>
  • I'm new to this so more than likely, i'm doing something wrong so beware.....you've got a programer newbie on your hands.....i did'nt use to have to do this.....my webmaster, the guy that built my first website, quit, so now i'm in a bit of a pickel
  • That should work.

    Upload it to your site that way I can run my debugger and see if anything is wrong with it.
  • This is where I have uploaded mine: Tutorials

    You can see it there in the middle.
  • Double post.
  • OK.....I got it.....I had to take out some junk around the <script> and </script> tags.......Thank you so much for all your hlep....you've been a lifesaver......just one other question.....

    How can I change the font and the font color?
  • Great

    Just change the entire document.write() statement with this one:

    Code:
    document.write("<span id='date'>"+days[current.getDay()] + ", " + months[current.getMonth()] + current.getDate() + ", " + current.getFullYear()+"</span>");
    Then in your CSS file add an id like so:

    Code:
    #date { color: #000000; font-family: Verdana;}
    Just change the color and font to whatever suits you

    Here is the entire (updated) script:

    Code:
    <script type="text/javascript">
    
    var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
    var months = ['January','February','March','April','May','June','July','August','September','October','November','December']
    
    var current = new Date();
    
    document.write("<span id='date'>"+days[current.getDay()] + ", " + months[current.getMonth()] + current.getDate() + ", " + current.getFullYear()+"</span>");
    </script>
  • great.....it's working......promise this is last question:

    how do i put a (space) after the word October? This is what it looks like now!!

    Thursday October2, 2008
    • [1] reply
    • Here it is:

      Code:
      <script type="text/javascript">
      
      var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
      var months = ['January','February','March','April','May','June','July','August','September','October','November','December']
      
      var current = new Date();
      
      document.write("<span id='date'>"+days[current.getDay()] + ", " + months[current.getMonth()] + " " + current.getDate() + ", " + current.getFullYear()+"</span>");
      </script>
      That should do it
      • [1] reply

Next Topics on Trending Feed