More work on the digital clock code! Minnesota

Today we begin playing around with replacing those image tags with the correct numbers, depending on what time it is.

Local Companies

Twin Cities Solutions, Inc.
952.881.6570
10800 Lyndale Ave S
Bloomington, MN
American Software and Global Technologies
(952) 885-5640
1650 W 82nd St
Minneapolis, MN
Lawson Software
651-767-7000
380 Saint Peter St
St. Paul, MN
Assessment Systems
651-647-9220
2233 University Ave W
St. Paul, MN
Automation Station Inc
651-224-1985
180 5th St E
St. Paul, MN
3 Sixty Software, LLC
612-961-0787
4209 Heathcote Rd
Wayzata, MN
Global Software
(612) 305-4472
10 S 5th St
Minneapolis, MN
Genuine Genuis Solutions
(612) 872-4256
431 Clifton Ave
Minneapolis, MN
Notion IT
(507) 276-9149
820 Sunrise Dr.
New Ulm, MN
Productive Corporation
612.375.0204
510 First Ave North Suite 310
Minneapolis, MN

provided by: 
Originally published at Internet.com


Tips...

Last week we learned the NAMEs attached to each of the HTML image tags. Today we begin playing around with replacing those image tags with the correct numbers, depending on what time it is.

Here's the code

The time is grabbed from the user's browser, so there's no need to worry about daylight savings time or time zones. As long as the viewer has his or her browser set correctly, you're good to go. If they don't, well, you can't help that.

Let's start at the top of the script just below the loading loop and code: function clock() { dates=new Date(); hour=dates.getHours(); min=dates.getMinutes(); sec=dates.getSeconds(); if(hour < 12) { amPM=am.src; } if(hour > 11) { amPM=pm.src; hour=hour-12; } if(hour == 0) { hour=12; } if(hour < 10) { document["tensHour"].src="http://www.developer.com/dgtbl.gif"; document["Hour"].src=d[hour].src; } if(hour > 9) { document["tensHour"].src=d[1].src; document["Hour"].src=d[hour-10].src; } if(min < 10) { document["tensMin"].src=d[0].src; } if(min > 9) { document["tensMin"].src=d[parseInt(min/10,10)].src; } document["Min"].src=d[min%10].src; if(sec < 10) { document["tensSec"].src=d[0].src; } if(sec > 9) { document["tensSec"].src=d[parseInt(sec/10,10)].src; } document["Sec"].src=d[sec%10].src; document["amPM"].src=amPM; setTimeout("clock();",100); } ...

Read article at Internet.com site

Featured Local Company

Twin Cities Solutions, Inc.

Twin Cities Solutions, Inc. is a privately owned information technology solutions firm primarily engaged in providing technical an

952.881.6570
10800 Lyndale Ave S
Bloomington, MN
http://www.twincs.com

Twin Cities Solutions, Inc. is a privately owned information technology solutions firm primarily engaged in providing technical and project management expertise to application development initiatives.

We are experienced in providing information technology solutions to government agencies as well as manufacturing, legal, financial and publishing business sectors.

Our team of consultants provides expertise to our clients in several key areas: E-Commerce applications, distributed applications, database development and desktop support.

Regional Articles
- More work on the digital clock code! Albert Lea MN
- More work on the digital clock code! Andover MN
- More work on the digital clock code! Anoka MN
- More work on the digital clock code! Bemidji MN
- More work on the digital clock code! Brainerd MN
- More work on the digital clock code! Burnsville MN
- More work on the digital clock code! Champlin MN
- More work on the digital clock code! Chanhassen MN
- More work on the digital clock code! Chaska MN
- More work on the digital clock code! Circle Pines MN
- More work on the digital clock code! Cloquet MN
- More work on the digital clock code! Cottage Grove MN
- More work on the digital clock code! Detroit Lakes MN
- More work on the digital clock code! Duluth MN
- More work on the digital clock code! Eden Prairie MN
- More work on the digital clock code! Elk River MN
- More work on the digital clock code! Excelsior MN
- More work on the digital clock code! Faribault MN
- More work on the digital clock code! Fergus Falls MN
- More work on the digital clock code! Forest Lake MN
- More work on the digital clock code! Hastings MN
- More work on the digital clock code! Hibbing MN
- More work on the digital clock code! Hopkins MN
- More work on the digital clock code! Inver Grove Heights MN
- More work on the digital clock code! Lakeville MN
- More work on the digital clock code! Mankato MN
- More work on the digital clock code! Minneapolis MN
- More work on the digital clock code! Minnetonka MN
- More work on the digital clock code! Moorhead MN
- More work on the digital clock code! Mound MN
- More work on the digital clock code! New Ulm MN
- More work on the digital clock code! Osseo MN
- More work on the digital clock code! Owatonna MN
- More work on the digital clock code! Prior Lake MN
- More work on the digital clock code! Red Wing MN
- More work on the digital clock code! Rochester MN
- More work on the digital clock code! Rosemount MN
- More work on the digital clock code! Saint Cloud MN
- More work on the digital clock code! Saint Paul MN
- More work on the digital clock code! Savage MN
- More work on the digital clock code! Shakopee MN
- More work on the digital clock code! South Saint Paul MN
- More work on the digital clock code! Stillwater MN
- More work on the digital clock code! Wayzata MN
- More work on the digital clock code! Willmar MN
- More work on the digital clock code! Winona MN

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML