Discuss Anything: Php Clock - Discuss Anything

Jump to content


Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
Page 1 of 1

Php Clock source Code Rate Topic: -----

#1 User is offline   alexia 

  • Super Member
  • PipPipPipPipPipPipPipPipPip
  • Group: Kontributors
  • Posts: 310
  • Joined: 09-February 05
  • Location:Italian
  • Interests:None
  • Current Mood: Current Mood:

Posted 11 March 2005 - 01:11 PM

Hi Every one i find this code its very easy simple php clock i think you can use it :angry:
<?
// Binary Clock
// script copyright© 2002 Andreas Tscharnuter
// questions? contact: psychodad@psychodad.at || [url=http://www.psychodad.at/clock/]http://www.psychodad.at/clock/[/url]
// free to use, copy and modify but leave comments untouched;)
// just include this file where your binary clock should appear
// version 1.2   03 September 2003

// below you can change different settings
// and remember to drink m000re milk!


$size =  "40";  //size of one square in pixel (height & width)
$hourdiff =  "0";  //difference between server time and local time + or -
$bgon =  "#cc0000";	//set color in hex for on (#cc0000 = darkred); check google.com for "hex color table" if you dont know how to use hex colors
$bgoff =  "#000000";	//set color in hex for off (#000000 = black); check google.com for "hex color table" if you dont know how to use hex colors 
$enableclock =	"1";  //switch the "real clock" beneath binary clock on(1) or off(0)


/*************************************
nothing needs to be changed below here
*************************************/
$std = str_pad((date("H") + $hourdiff + 24) % 24,2,"0",STR_PAD_LEFT);
$min = date("i");
$sec = date("s");

if ($std > 24 || $std < 0) {
	die("<b><font color=\"#cc0000\">$std:$min no way... =)</font></b>");
}
$std1 = decbin(substr($std,0,1));
$std2 = decbin(substr($std,1,1));
$min1 = decbin(substr($min,0,1));
$min2 = decbin(substr($min,1,1));
$sec1 = decbin(substr($sec,0,1));
$sec2 = decbin(substr($sec,1,1));
function reihe($kette,$anfang,$ende) {  //background output
	global $size,$bgon,$bgoff;
	$pad = str_pad($kette,4,"0",STR_PAD_LEFT);
	if(substr($pad,$anfang,$ende)==1) {
  echo "<td width=\"$size\" height=\"$size\" bgcolor=\"$bgon\">&nbsp;</td>";
	} else {
  echo "<td width=\"$size\" height=\"$size\" bgcolor=\"$bgoff\">&nbsp;</td>";
	}
}
?>
<table cellpadding="0" cellspacing="1" border="0" bgcolor="#000000">
	<tr>
  <td>
<table cellpadding="0" cellspacing="1" border="0" bgcolor="#cccccc">
<tr>
	<td colspan="2" align="center"><i><font face="verdana" size="1">hour</font></i></td>
	<td colspan="2" align="center"><i><font face="verdana" size="1">min</font></i></td>
	<td colspan="2" align="center"><i><font face="verdana" size="1">sec</font></i></td>	
</tr>
<tr><?
	reihe($std1,0,1);
	reihe($std2,0,1);
	reihe($min1,0,1);
	reihe($min2,0,1);
	reihe($sec1,0,1);
	reihe($sec2,0,1);
?></tr>
<tr><?
	reihe($std1,1,1);
	reihe($std2,1,1);
	reihe($min1,1,1);
	reihe($min2,1,1);
	reihe($sec1,1,1);
	reihe($sec2,1,1);
?></tr>
<tr><?
	reihe($std1,2,1);
	reihe($std2,2,1);
	reihe($min1,2,1);
	reihe($min2,2,1);
	reihe($sec1,2,1);
	reihe($sec2,2,1);
?></tr>
<tr><?
	reihe($std1,3,1);
	reihe($std2,3,1);
	reihe($min1,3,1);
	reihe($min2,3,1);
	reihe($sec1,3,1);
	reihe($sec2,3,1);
?>
</tr>
<?
if ($enableclock == 1) {	//disables,enables bottom clock
?>
<tr>
	<td align="center" colspan="2"><font face="verdana" size="1"><? echo $std ?></font></td>
	<td align="center" colspan="2"><font face="verdana" size="1"><? echo $min ?></font></td>
	<td align="center" colspan="2"><font face="verdana" size="1"><? echo $sec ?></font></td>
</tr>
<? } ?>
</table>
  </td>
	</tr>
</table>


Darkmeca - ok first of all you need to put this in quote or code, second you must credit the author of the code. This is your first warning if this happens again further actions will be taken. Thank you.

This post has been edited by darkmeca: 11 March 2005 - 01:37 PM

0


Page 1 of 1

Other Replies To This Topic

#2 User is offline   alexia 

  • Super Member
  • PipPipPipPipPipPipPipPipPip
  • Group: Kontributors
  • Posts: 310
  • Joined: 09-February 05
  • Location:Italian
  • Interests:None
  • Current Mood: Current Mood:

Posted 11 March 2005 - 01:13 PM

sorry i posting again but i forget told u
you can Customize this clock (font,Size,Color)...
0

#3 User is offline   OwrLam 

  • Newbie [Level 3]
  • PipPipPip
  • Group: Kontributors
  • Posts: 46
  • Joined: 17-March 05
  • Current Mood: Current Mood: None Chosen

Posted 17 March 2005 - 05:18 PM

Also displays information about time:

<?php
  print "<p>Current Date: <br><br><strong>";
  print date("D d.m.Y G:i:s") . "<br>";
  print date("F j, Y, g:i a") . "<br>";
  print date("m.d.y") . "<br>";
  print date("j, n, Y") . "<br>";
  print date("Ymd") . "<br>";
  print date('h-i-s, j-m-y, it is w Day z ') . "<br>";
  print date('\i\t \i\s \t\h\e jS \d\a\y.') . "<br>";
  print date("D M j G:i:s T Y") . "<br>";
  print date('H:m:s \m \i\s\ \m\o\n\t\h') . "<br>";
  print date("H:i:s") . "<br>";
  print "</strong></p>\n";
?>

0

#4 User is offline   iGuest 

  • Hail Caesar!
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Kontributors
  • Posts: 5,876
  • Joined: 21-September 07
  • Interests:Trap17 Free Web Hosting, No Ads
  • Current Mood: Current Mood: None Chosen

Posted 07 January 2008 - 02:55 AM

analog clock
Php Clock

I wanna put/make analog clock in my web page.
But I don't know how..
Can you give me some tips or guide how to make it?

-eney
0

#5 User is offline   jlhaslip 

  • Insert Custom Title Here
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: [MODERATOR]
  • Posts: 5,035
  • Joined: 24-July 05
  • Gender:Male
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • Interests:http://jim.haslip.googlepages.com/home
  • myCENT:43.02
  • Spam Patrol
  • Current Mood: Current Mood: None Chosen

Posted 07 January 2008 - 04:32 AM

Try this site:

http://free-flash-clocks.trap17.com/
0

#6 User is offline   coldasice 

  • Newbie [Level 2]
  • PipPip
  • Group: Kontributors
  • Posts: 34
  • Joined: 10-December 07
  • Gender:Male
  • Location:Norway
  • Current Mood: Current Mood: None Chosen

Posted 07 January 2008 - 09:01 PM

how to make this clock auto refresh =?

or go like those flash clocks =) is what i realy meant :)
0

#7 User is offline   galexcd 

  • Define:EVIL PROGRAMMER (ē'vəl prō'grăm'ər)- n. An organism that converts caffeine into evil software.
  • PipPipPipPipPipPipPipPipPipPipPip
  • View gallery
  • Group: [MODERATOR]
  • Posts: 1,328
  • Joined: 25-September 05
  • Gender:Male
  • Location:Los Angeles, California
  • myCENT:44.33
  • Current Mood: Current Mood: None Chosen

Posted 09 January 2008 - 06:43 AM

View Postcoldasice, on Jan 7 2008, 01:01 PM, said:

how to make this clock auto refresh =?

or go like those flash clocks =) is what i realy meant :)


You could have js do some ajax to get the updated time and format if you wanted to use the php code, but it would just be easier to do the whole thing in js if you want it to update automatically.
0

#8 User is offline   coldasice 

  • Newbie [Level 2]
  • PipPip
  • Group: Kontributors
  • Posts: 34
  • Joined: 10-December 07
  • Gender:Male
  • Location:Norway
  • Current Mood: Current Mood: None Chosen

Posted 13 January 2008 - 05:41 PM

View Postalex7h3pr0gr4m3r, on Jan 9 2008, 07:43 AM, said:

You could have js do some ajax to get the updated time and format if you wanted to use the php code, but it would just be easier to do the whole thing in js if you want it to update automatically.


thanks.. i dont know ajax.. only php.. dont know js either =D

but i get to it =D
0

#9 User is offline   iGuest 

  • Hail Caesar!
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Kontributors
  • Posts: 5,876
  • Joined: 21-September 07
  • Interests:Trap17 Free Web Hosting, No Ads
  • Current Mood: Current Mood: None Chosen

Posted 06 July 2009 - 06:02 AM

Cool Java clockPhp Clock

<script type="text/javascript" src="http://cdn.Widgetserver.Com/syndication/subscriber/InsertWidget.Js"></script> <script>if (WIDGETBOX) WIDGETBOX.RenderWidget('6e74a8f1-9e55-4fd3-80ae-c0c522dd9fa5');</script><noscript>Get the <a href="http://www.Widgetbox.Com/widget/classic-clock">Classic Clock</a> widget and many other <a href="http://www.Widgetbox.Com/">great free widgets</a> at <a href="http://www.Widgetbox.Com">Widgetbox</a>!</noscript> 

Java script for  clock

-reply by MegaScript
0

Share this topic:


Page 1 of 1


Similar Topics Collapse

  Topic Forum Started By Stats Last Post Info
Locked Topic Icon How To Host Ur Own Site In 2 Mins Php+mysql Needed Tutorials doom145 
  • 34 Replies
  • 9,434 Views
New Replies Icon Rate My Php-based Site Website Reviews Mike 
  • 11 Replies
  • 1,701 Views
New Replies Icon Changing Php Classes Using Onclick HTML, XML etc.. fffanatics 
  • 7 Replies
  • 1,961 Views
*New Replies Icon Please read this if you know PHP and MySQL! General Talk Guest_hpforums_* 
  • 7 Replies
  • 909 Views
New Replies Icon Phpbb 2.0.18 Released Software bureX 
  • 5 Replies
  • 1,111 Views
New Replies Icon Reading Site's Source Code With Php
is this possible?
PHP Programming snlildude87 
  • 8 Replies
  • 2,063 Views
New Replies Icon New Real Phpbb Forum Started With My Trap17 Accoun
clan Finaldark
Website Discussion Final)arkJon 
  • 2 Replies
  • 1,659 Views
New Replies Icon Shoutbox For Phpbb3 PHP Programming kobra500 
  • 1 Reply
  • 2,615 Views
New Replies Icon Need Help For Php Code PHP Programming amrytech 
  • 4 Replies
  • 90 Views
New Replies Icon Php, Mysql, Apache PHP Programming robocz033 
  • 4 Replies
  • 999 Views
New Replies Icon Know Any Free Php Online Catalog Scripts Web Design affhotspot 
  • 6 Replies
  • 2,104 Views
New Replies Icon Need Help Setting Up Php Scripts
Have website scripts written in PHP, but need help!
PHP Programming DarkNova 
  • 4 Replies
  • 624 Views
Locked Topic Icon Php : Undefined Function Imagecreatefromjpeg() ?! Technical Support justtobeseen 
  • 2 Replies
  • 1,109 Views
Locked Topic Icon My Pc Is Over-over-clocked [resolved] Operating Systems -Sky- 
  • 24 Replies
  • 835 Views
New Replies Icon phpbb header
i think i did somthing wrong
your Secret HideOut avy 
  • 1 Reply
  • 5,485 Views
New Replies Icon Html Editors That Work With Asp Php
wondering mind
Web Design Saint_Michael 
  • 10 Replies
  • 9,577 Views
New Replies Icon Can Any One Help Me In Php Mysql PHP Programming bdweb 
  • 2 Replies
  • 999 Views
*New Replies Icon phpnuke and phpbb General Talk Guest_l33tg33k_* 
  • 3 Replies
  • 2,464 Views
Locked Topic Icon Can You Add Images Into A Mysql Database?
Using Php?
PHP Programming midnightvamp 
  • 24 Replies
  • 5,990 Views
New Replies Icon Php Calculator That Calculates Genetic Percentages?
I need help finding sites or tutorials.
PHP Programming TheChosenDarkness 
  • 2 Replies
  • 1,274 Views

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Google Fan :-) We Recommend Firefox.     Customize / Settings Connect Us on facebook