Calculate Site Uptime Using PHP

Supplying additional information to your website can be a nice statistics display. One of them is to make use of PHP to display the site uptime up to date.

It is quite easy to do so if you know a little bit about programming or (PHP programming).

(learn to use PHP to calculates site uptime...)

First of all, you need to have a PHP-enabled site in order to do this. You can use this in WordPress as well, but a runPHP plugin (for WordPress is required.

Source Code
<?php
  $createDate = "14-Feb-2008"; /* your start date here */
  $days = floor((time() - strtotime($createDate))/86400)+1;
  echo ("Website Creation Date: <b>$createDate</b><br />Website Uptime: <b>$days</b> days");
?>

The result from this code is shown below:

Website Creation Date: 14-Feb-2008
Website Uptime: 189 days

A few lines of code can simply illustrate a much more informative and statistical display on your website. So, why not try it?

Posted in | | Submitted by keith on Sun, 2008-02-17 05:06.
read more | add new comment

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Use <!--pagebreak--> to create page breaks.
More information about formatting options

Syndicate, Bookmark & Sitemap

Syndicate Content Bookmark This Site NeoHide SiteMap

Quick Search

User login

Search

Sponsored Ads

Women's Corner

Who's new

  • akibsayyed
  • biomarwan
  • movjerap
  • hackernet
  • sZwCGKObKbpH

Syndicate

Syndicate content

FastBox Ad Feed

Subscribe Feeds

Feed Icon
Google
Yahoo!
Bloglines
Newsgator
MSN
Feedster
AOL
Furl
Rojo
Newsburst
Pluck
FeedFeeds
Add Kinja
SoloSub
MultiRSS
rMail
RSSFwd
Blogarithm
Eskobo
GritWire
BotABlog
Monitor This
Simplify