Digital clock
-
How to program to display clock time including seconds like digital clock in master page?
-
How to program to display clock time including seconds like digital clock in master page?
-
How to program to display clock time including seconds like digital clock in master page?
The better and simpliest solution I think, Create a
Flash file of Digital Clock
. embed it with asp.net page.Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article
-
The better and simpliest solution I think, Create a
Flash file of Digital Clock
. embed it with asp.net page.Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article
I need system date & time to be displayed in master page.
-
I need system date & time to be displayed in master page.
Yes. Create a Flash Digital Clock and set it on master page ;)
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article
-
I need system date & time to be displayed in master page.
place the javascript function in your masterpage
var clock;
function stopClock(){
clearTimeout(clock);
}function yourClock(){
var nd = new Date();
var h, m;
var s;
var time = " ";
h = nd.getHours();
m = nd.getMinutes();
s = nd.getSeconds();
if (h <= 9) h = "0" + h;
if (m <= 9) m = "0" + m;
if (s <= 9) s = "0" + s;
time += h + ":" + m + ":" + s;
document.getElementbyId('yourclockbox').value = time;
clock = setTimeout("yourClock()", 1000);
}Now in body tag of your masterpage use :
<BODY onLoad="yourClock()", onUnload="stopClock(); return true">
Place one div namedyourclockbox
in your page. Apply proper CSS. You are done... :thumbsup::thumbsup:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
-
place the javascript function in your masterpage
var clock;
function stopClock(){
clearTimeout(clock);
}function yourClock(){
var nd = new Date();
var h, m;
var s;
var time = " ";
h = nd.getHours();
m = nd.getMinutes();
s = nd.getSeconds();
if (h <= 9) h = "0" + h;
if (m <= 9) m = "0" + m;
if (s <= 9) s = "0" + s;
time += h + ":" + m + ":" + s;
document.getElementbyId('yourclockbox').value = time;
clock = setTimeout("yourClock()", 1000);
}Now in body tag of your masterpage use :
<BODY onLoad="yourClock()", onUnload="stopClock(); return true">
Place one div namedyourclockbox
in your page. Apply proper CSS. You are done... :thumbsup::thumbsup:Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.
I used like this but its showing nothing.
-
I used like this but its showing nothing.
Just a little modification required.Use the script below:
var clock; function stopClock(){ clearTimeout(clock); } function yourClock(){ var nd = new Date(); var h, m; var s; var time = " "; h = nd.getHours(); m = nd.getMinutes(); s = nd.getSeconds(); if (h <= 9) h = "0" + h; if (m <= 9) m = "0" + m; if (s <= 9) s = "0" + s; time += h + ":" + m + ":" + s; document.getElementById('yourclockbox').innerHTML = time; clock = setTimeout("yourClock()", 1000); }
If you want to show the element inside a div use innerHTML rather than value. Label1 is also not declared. :rose::rose:
Abhishek Sur
My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB
**Don't forget to click "Good Answer" if you like to.