how do I automatically make the website show tomorrow's date? or number?

Discussion in 'HTML & Website Design' started by shamrock36, Mar 20, 2008.

  1. #1
    Hi,
    How can I code a page in html, some function that would show a certain number, probably according to the user's date?

    for example, If I wanna create a page with a line that would say:

    All Inquieries would be responded until 25th March.

    and today's date is 20th,

    so I want that tomorrow, on the 21th, the line would be
    "All Inquieries would be responded until 26th March."

    without having to change it manually. is it possible with some server side include maybe? I don't want the client to see that it is some sort of script in the sourch, but to see it as if it was a regular coded line....

    I'm not necessarily looking for a function that would list the date according to the user's own date, or that would also change the presentation of the month, like from March to April, because I don't know if its possible,
    so I'm ready to compromise with just having the number automatically bounce, in one number up, each day, according to the date in my Server

    hope you get what I mean, it was a little hard to explain.:confused:

    thanks!
     
    shamrock36, Mar 20, 2008 IP
  2. paul_delaney

    paul_delaney Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This can be done using ASP are the pages just basic .html?
     
    paul_delaney, Mar 20, 2008 IP
  3. shamrock36

    shamrock36 Active Member

    Messages:
    180
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Yes they are :(
     
    shamrock36, Mar 20, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It depends how robust you want it to be.... the best option is to do it serverside the below is an inline code for ASP/.Net where 5 is the number of days to advance by, you would probably want to add formatting otherwise it defaults to the servers culture settings

    <%=Now.AddDays(5)%>
    Code (markup):
    You could do it with javascript client side but then you are subject to their PCs date not your servers and if javascript is turned off then it wont work.
     
    AstarothSolutions, Mar 20, 2008 IP
  5. shamrock36

    shamrock36 Active Member

    Messages:
    180
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #5
    so there is no other way??

    I don't want to use java, and I don't know asp and my pages are all .html

    no way to do it with server side include for regular html files??
     
    shamrock36, Mar 22, 2008 IP
  6. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #6
    Javascript would be another option (although it would depend on the user having javascript enabled).

    Other than that it'd have to be a server side language as stated before (but if your pages are all html at the moment it'd be easier to go with javascript).
     
    twistedspikes, Mar 22, 2008 IP