Results 1 to 3 of 3

Thread: Count Up Script

  1. #1
    Join Date
    Dec 2012
    Thanked 0 Times in 0 Posts

    Default Count Up Script


    I'm hoping someone can assist me. I'm looking for a Count Up Script which I can use on a New Ticker page which counts from the day the message was published (i.e. starts with "Today" when published, changes to "Yesterday" the next day "2 Days Ago", "1 Week Ago" etc.

    Dynamic Drive has a Count up Script but has Minutes, hours and seconds which I don't require. Would this be suitable for what I'm looking for and if so how could I modify

    Any advice appreciated

  2. #2
    Join Date
    Jul 2008
    Derbyshire, UK
    Thanked 439 Times in 437 Posts
    Blog Entries


    What exactly is a "news ticker" page?

    And how are you recording the publication date? Is that something which is stored in a database? Of maybe a last modified timestamp of a news entry file? Or the pubDate from an RSS feed? Or a static variable saved/written on the page itself?

    This type of thing is usually easier and more accurate being calculated on the server side, so PHP would probably be the way to go. Is your server setup to run PHP? Assuming it is, these functions should do what you ask

    If you need more help, please provide a link to your page and give more information about how news dates/entries are being stored.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Dec 2008
    Portsmouth, UK
    Thanked 438 Times in 432 Posts


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="" xml:lang="en" lang="en">
    <span id="posted" ></span>
    <script type="text/javascript">
    function zxcDaysPosted(o){
     var obj=document.getElementById(o.ID),p=o.Date,p=typeof(p)=='string'?p.split(/\D/):[],d,w;
     if (obj&&isFinite(p[0])&&isFinite(p[1])&&isFinite(p[2])){
      d=Math.floor((new Date()-new Date(p[0],p[1]-1,p[2]))/(1000*60*60*24));
      obj.innerHTML=w+' Weeks '+(d-(w*7))+' Days';{ zxcDaysPosted(o); },60000);
    God Loves You and will never love you less.
    If my post has been useful please donate to

Similar Threads

  1. Count Up Script?
    By F0u4d in forum JavaScript
    Replies: 16
    Last Post: 05-28-2012, 05:49 AM
  2. Count up script?
    By atomic7732 in forum PHP
    Replies: 7
    Last Post: 12-23-2010, 02:04 AM
  3. Looking for a count up script
    By darmie_a_Phoenix in forum Dynamic Drive scripts help
    Replies: 24
    Last Post: 03-22-2010, 07:08 PM
  4. Count down script
    By Scrounger in forum Dynamic Drive scripts help
    Replies: 9
    Last Post: 08-08-2007, 10:29 PM
  5. Count Down Script
    By kjenkins in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 12-10-2004, 10:45 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts