Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 76

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 571

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 572

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/libraries/cmslib/spframework.php on line 580

Deprecated: Function eregi() is deprecated in /home/content/48/9096548/html/xfunda.com/templates/ja_barite/ja_menus/Base.class.php on line 62
JavaScript Status Text Clock

Excellent Fundamental...!!!

 
  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • green color
  • blue color

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/com_jomcomment/bbcode.php on line 172

Deprecated: Assigning the return value of new by reference is deprecated in /home/content/48/9096548/html/xfunda.com/components/com_jomcomment/bbcode.php on line 956

JavaScript Status Text Clock

E-mail Print PDF

JavaScript Status Text Clock

Here we are going to display Text Clock at status bar of browser. If you are interested in details then please go through JavaScript Status clock – Basic and JavaScript Status clock – Advance.

First of all we have define variable var currentDate=new Date() and create a date object. Then define function NumToText() which take input as number which is output of method supported by date object.

hour = NumToText(currentDate.getHours())
min = NumToText(currentDate.getMinutes())
sec = NumToText(currentDate.getSeconds())

It process and depending on input parameter it return output as text. And we will get output as shown in figure below…

JavaScript Status Text Clock

Go through complete code to get detail how code works…

<script type="text/javascript">

function time(){
var TimeStamp,hour,period,min,sec;
var currentDate=new Date()

function NumToText(timestamp){
var y;
switch(timestamp){
case 0:y="Zero";break;
case 1:y="One";break;
case 2:y="Two";break;
case 3:y="Three";break;
case 4:y="Four";break;
case 5:y="Five";break;
case 6:y="Six";break;
case 7:y="Seven";break;
case 8:y="Eight";break;
case 9:y="Nine";break;
case 10:y="Ten";break;
case 11:y="Eleven";break;
case 12:y="Twelve";break;
case 13:y="Thirteen";break;
case 14:y="Fourteen";break;
case 15:y="Fifteen";break;
case 16:y="Sixteen";break;
case 17:y="Seventeen";break;
case 18:y="Eighteen";break;
case 19:y="Nineteen";break;
case 20:y="Twenty";break;
case 21:y="TwentyOne";break;
case 22:y="TwentyTwo";break;
case 23:y="TwentyThree";break;
case 24:y="TwentyFour";break;
case 25:y="TwentyFive";break;
case 26:y="TwentySix";break;
case 27:y="TwentySeven";break;
case 28:y="TwentyEight";break;
case 29:y="TwentyNine";break;
case 30:y="Thirty";break;
case 31:y="ThirtyOne";break;
case 32:y="ThirtyTwo";break;
case 33:y="ThirtyThree";break;
case 34:y="ThirtyFour";break;
case 35:y="ThirtyFive";break;
case 36:y="ThirtySix";break;
case 37:y="ThirtySeven";break;
case 38:y="ThirtyEight";break;
case 39:y="ThirtyNine";break;
case 40:y="Fourty";break;
case 41:y="FourtyOne";break;
case 42:y="FourtyTwo";break;
case 43:y="FourtyThree";break;
case 44:y="FourtyFour";break;
case 45:y="FourtyFive";break;
case 46:y="Fourtyix";break;
case 47:y="FourtySeven";break;
case 48:y="FourtyEight";break;
case 49:y="FourtyNine";break;
case 50:y="Fifty";break;
case 51:y="FiftyOne";break;
case 52:y="FiftyTwo";break;
case 53:y="FiftyThree";break;
case 54:y="FiftyFour";break;
case 55:y="FiftyFive";break;
case 56:y="FiftySix";break;
case 57:y="FiftySeven";break;
case 58:y="FiftyEight";break;
case 59:y="FiftyNine";break;
}
return y;
}
hour =NumToText(currentDate.getHours())
min = NumToText(currentDate.getMinutes())
sec = NumToText(currentDate.getSeconds())

if (hour>12){hour-=12;period="PM"} else {period="AM"}
if (currentDate.getHours()==12){period="PM"}
if (currentDate.getHours()==24){period="AM"}

var TimeStamp=hour+" O\'clock : "+min+" Minute: "+sec+" Second "+period
window.status=TimeStamp
window.setTimeout("time()",300)
}
time()
</script>

Example:

Please download source code to see example...

Source Code:

Download Source code for ‘JavaScript Status Text Clock’

Download

Also See:

Trackback(0)
Comments (1)Add Comment
...
written by Navin sharma, September 27, 2009
nice
'n' finally very nice

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

busy
Last Updated ( Thursday, 28 February 2008 15:44 )  

Articles


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Adobe Gallery


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Community


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

FAQ's


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Resources


Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/content/48/9096548/html/xfunda.com/libraries/joomla/cache/handler/callback.php on line 100

Who's Online

We have 13 guests online

Subscribe Feeds

Enter your email address:

Sponsor Adds


Submit Article

We want to develop such a Community portal which will provide a good resource on latest hot technologies such as .NET, VB.NET, C#.NET, ADO.NET, ASP.NET, PHP, Flash, Photoshop. If you like to write for us, this guideline for you. please send your article, faqs on admin[at]xfunda.com

Adobe Gallery Photoshop Tutorials...

Photoshop Tutorial - Create Colorful Composition in Photoshop Photoshop Tutorial - Create Colorful Composition in Photoshop Photoshop Tutorial - Create Colorful Composition in Photoshop Category - Photoshop >> illustration and Art. ...
 
Photoshop Tutorial - Create a Nice Autumn Scenery in Photoshop Photoshop Tutorial - Create a Nice Autumn Scenery in Photoshop Photoshop Tutorial - Create a Nice Autumn Scenery in Photoshop Category - Photoshop >> illustration and Art. ...
 
Photoshop Tutorial - Create a Beautiful Lonely Fantasy Fairy Photoshop Tutorial - Create a Beautiful Lonely Fantasy Fairy Photoshop Tutorial - Create a Beautiful Lonely Fantasy Fairy Category - Photoshop >> illustration and Art. ...
 
Photoshop Tutorial - How To Create a Futuristic Sci-Fi Scene Photoshop Tutorial - How To Create a Futuristic Sci-Fi Scene Photoshop Tutorial - How To Create a Futuristic Sci-Fi Scene Category - Photoshop >> Photo Effects. ...
 
Photoshop Tutorial - Goddess cadeira photo effect in Photoshop Photoshop Tutorial - Goddess cadeira photo effect in Photoshop Photoshop Tutorial - Goddess cadeira photo effect in Photoshop Category - Photoshop >> Photo Effects. ...