NameSilo

This may seem odd, but I need a countUP timer.

Spaceship Spaceship
Watch

Barrucadu

Established Member
Impact
64
I need a simple javascript applet which will say: "Poetry Dreams has been online for x Days x Hours x Minuits x Seconds."

I dont know if its ever been done, countdown timers seem more popular, but i need a countup timer.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Mikor,

If you can be able to output it with PHP I can do it. I am not that fimiliair with Javascript to do this.

iNod
 
0
•••
Code:
<SCRIPT LANGUAGE="JavaScript">

var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
function countup(yr,m,d) {
var today=new Date();
var todayy=today.getYear();


if ((navigator.appName == "Microsoft Internet Explorer") && (todayy < 2000))
todayy="19" + todayy;
if (navigator.appName == "Netscape")
todayy=1900 + todayy;

var todaym=today.getMonth();
var todayd=today.getDate();
var todaystring=montharray[todaym]+" "+todayd+", "+todayy;
var paststring=montharray[m-1]+" "+d+", "+yr;
var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1);

document.write("Your website was created " + difference + " days ago.");

}
countup(1997,08,29); 
</script>

Should output something like:

"Your website was created 200 days ago"
 
0
•••
For a PHP solution, you could use something like:

PHP:
<?php

$now = strtotime("now");
//Start date
$start = strtotime("October 23, 2005"); 
$diff = $now - $start;
$num = $diff/86400;
//Days
$days = intval($num); 
$num2 = ($num - $days) * 24;
//Hours
$hours = intval($num2); 
$num3 = ($num2 - $hours) * 60;
//Minutes
$minutes = intval($num3); 

echo "Site has been online for: ".$days." days, ".$hours." hours, ".$mins." minutes.";

?>
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back