41 users online (0 members and 41 guests)  


  Results 1 to 4 of 4

Related

  1. Hello I am newbie here    Forum: Introduce Yourself
    Replies: 0
  2. Newbie    Forum: Search Engine Optimization - SEO - Forum
    Replies: 0
  3. newbie    Forum: General Discussion
    Replies: 0
  4. i'm a newbie    Forum: Web Hosting Forum
    Replies: 2
  1. #1
    Cicerello's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2006
    Location
    Perth, Australia
    Posts
    1

    Newbie needs help

    Hey all.

    Sorry if this has already been posted and answered but i did search the forum first and couldnt find it.

    I am trying to add a 'day counter' to my web page. For example "it has been ## days since blah blah blah"

    At the moment i am editing my web page on a daily basis to update the number of days and it is very time consuming.

    Any help would be greatly appreciated.

    Cicerello

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Newbie needs help

    Welcome to the forum, Cicerello!

    You would need to have some sort of file that stored the start date in it. That file could be a text file, or if you had some other uses for it as well, a database such as MySQL. You'll need to use some sort of scripting language such as PHP if you want the number of days to be calculated. It isn't terribly difficult to do.

    Hope this helps.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  3. #3
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Newbie needs help

    If you are tracking only one event, a small file will suffice.
    If you need to track multiple events, you will need a database. Make sure that one of the fields is a "dateCreated" field and you can calculate the time passed since creation with PHP each time the page is loaded.

  4. #4
    theprophecy19's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2006
    Posts
    1

    Re: Newbie needs help

    Put the script in below and you should be good:
    <script type="text/javascript">
    var minutes = 1000*60
    var hours = minutes*60
    var days = hours*24
    var years = days*365
    var d = new Date()
    var t = d.getTime()
    var y = t/years
    document.write("It's been: " + y + " years since 1970/01/01!")
    </script>



Tags for this Thread