Pages: [1] 2   Go Down
  Print  
Author Topic: Displaying server time on Site  (Read 1775 times)
dakshhmehta
Newbie
*
Offline Offline

Posts: 6


View Profile
« on: June 10, 2010, 04:49:43 AM »

Hello, today i will going to give you code to display server time on your site...

Code:
<?php echo date('d-m-Y H:i:s'time()); ?>

Paste above where you want to display Server time, i recommand you to paste it in layout.php. so, in all page server time will be displayed...

Here, in code i have used simple format i.e dd/mm/yyyy HH:MM:SS..

You can check more format combination at official site php.net

Thank you...
Logged
Upgrade to an SDR 3
757jterrell
Administrator
Hero Member
*****
Offline Offline

Posts: 1637



View Profile WWW
« Reply #1 on: June 12, 2010, 03:44:51 PM »

This is great. The admins here I am sure a very grateful.

Thanks again,
JT
« Last Edit: June 14, 2010, 05:52:09 PM by 757jterrell » Logged

gsbux
Full Member
***
Offline Offline

Posts: 185


View Profile
« Reply #2 on: June 13, 2010, 07:25:19 AM »

Thanks dear, but I have one problem. It is not counting, just shows the exact time when the page is loaded.
Logged
dakshhmehta
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #3 on: June 14, 2010, 03:13:19 PM »

Ya, you right, of you want live timer, then you should user JQuery, ill make one function...and as soon as possible ill post here..
Logged
gsbux
Full Member
***
Offline Offline

Posts: 185


View Profile
« Reply #4 on: June 15, 2010, 03:15:59 PM »

Ya, you right, of you want live timer, then you should user JQuery, ill make one function...and as soon as possible ill post here..

Waiting for it  Wink
Logged
dakshhmehta
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #5 on: June 27, 2010, 12:12:41 PM »

Live timer created.. Pm me your email.. ill send you addon file..
Logged
caksono
Newbie
*
Offline Offline

Posts: 12


View Profile
« Reply #6 on: July 26, 2010, 07:07:34 AM »

This is are live server timer, it show's time server accuracy and it counting (Live and using Java) :

For Sample please visit my site http://www.actionptc.com  (i do not know are this link allowed or no)

## Pm me for help ##


in this case i used standard php method so i commented the SSI (//), if using SSI method commented the php method and uncommented SSI :



// Current Server Time script (SSI or PHP)- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use.


<script type="text/javascript">


// ------- SSI method of getting server date----- removed the // under //
//var currenttime = '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' //-------------------------------------------------------------------//


//-------PHP method of getting server date ----- removed the // under //

var currenttime = '<? print date("F d, Y H:i:s", time())?>'

//-------------------------------------------------------------------//

///////////Stop editting here/////////////////////////////////

var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var serverdate=new Date(currenttime)

function padlength(what){
var output=(what.toString().length==1)? "0"+what : what
return output
}

function displaytime(){
serverdate.setSeconds(serverdate.getSeconds()+1)
var datestring=montharray[serverdate.getMonth()]+" "+padlength(serverdate.getDate())+", "+serverdate.getFullYear()
var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds())
document.getElementById("servertime").innerHTML=datestring+" "+timestring
}

window.onload=function(){
setInterval("displaytime()", 1000)
}

</script>
<b>Server Time:</b> <span id="servertime"></span>
« Last Edit: July 28, 2010, 09:51:04 PM by caksono » Logged
dakshhmehta
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #7 on: July 27, 2010, 10:21:42 AM »

Nice one.

But i think it;s not coded by you.
Logged
caksono
Newbie
*
Offline Offline

Posts: 12


View Profile
« Reply #8 on: July 27, 2010, 01:04:13 PM »

yes, it's not coded by me, i just sharing it, i got from some source (free one) i forgot where it is, so i think it's okay to share it to other as long it usefull,

Logged
cARRIE
Administrator
Hero Member
*****
Offline Offline

Posts: 1458



View Profile WWW
« Reply #9 on: July 27, 2010, 01:29:41 PM »

It's ok, but next time leave credits, if there any.  Wink
Logged

caksono
Newbie
*
Offline Offline

Posts: 12


View Profile
« Reply #10 on: July 27, 2010, 05:59:30 PM »

 Cheesy Cheesy i forgot where i got it, i will added if i remember it
Logged
waqas
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #11 on: August 07, 2010, 12:21:13 AM »

hi guys i m new in starting aurora can anyone tell me how i should put this live timer in my site
Logged
cARRIE
Administrator
Hero Member
*****
Offline Offline

Posts: 1458



View Profile WWW
« Reply #12 on: August 08, 2010, 04:10:28 AM »

http://www.javascriptkit.com/script/script2/servertime.shtml

Hope it helps.
Logged

gsbux
Full Member
***
Offline Offline

Posts: 185


View Profile
« Reply #13 on: August 08, 2010, 04:32:34 AM »


http://auroraadmintraining.info/index.php/topic,442.0.html 
 Grin
Logged
cARRIE
Administrator
Hero Member
*****
Offline Offline

Posts: 1458



View Profile WWW
« Reply #14 on: August 08, 2010, 04:35:58 AM »

Sorry, i did not mean to steal something.
I thought he would like a link with an explanation.
Logged

Get a SDR 3 NOW at http://ptcfactory.info

The best and most up to date Aurora script in the market!!
Pages: [1] 2   Go Up
  Print  
 
Jump to: