Needing help to add date script to web site.

Discussion in 'HTML & Website Design' started by VOLVORacr, Aug 3, 2007.

  1. #1
    I've had no luck trying to find a script or something else I can use that will automatically change the date on my site to the current date.

    Only thing I can find is a webbot but that still requires the page to be resaved and uploaded again daily.

    Suggestions?

    Thanks!
     
    VOLVORacr, Aug 3, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you wanting the date to show as per the clients computer date? if so you need to use javascript.

    Are you wanting the date to show as per the servers date (or a date relative to this timezone)? in which case you need to use a server side element.

    An exceptionally simple way to do it serverside with .Net would be to include the code <%=Now().ToString("dd-MMM-yy")%>
     
    AstarothSolutions, Aug 4, 2007 IP
  3. VOLVORacr

    VOLVORacr Active Member

    Messages:
    67
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #3
    The method isn't important as long as I don't have to change it my self every day.

    I tried the code included but i'm probably not doing it correctly.

    I'm using Frontpage 2003, but don't know anything about using .Net :confused:
     
    VOLVORacr, Aug 4, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You need to ensure that your webhost supports .Net (ie it is windows based). There will be a similar code for PHP if you have *nix webhosting

    In either case the date wont actually show until it is running on the webhost
     
    AstarothSolutions, Aug 5, 2007 IP
  5. VOLVORacr

    VOLVORacr Active Member

    Messages:
    67
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #5
    Thanks for your help I found a java script that works

    :D
     
    VOLVORacr, Aug 5, 2007 IP
  6. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #6
    As said, the javascript will write the date as per the client rather than the server so if they are in a different timezone you may have issues subject to if anything is dependent on the date or if it is just for info purposes

    At the moment the javascript isnt working correctly in either FF or IE7 - though the errors are actually different if it is the date in the top right of your homepage in the signiture link
     
    AstarothSolutions, Aug 5, 2007 IP