Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / August 2005

Tip: Looking for answers? Try searching our database.

Java clock offsettable by minutes?

Thread view: 
James Gifford - 31 Jul 2005 21:38 GMT
I'm trying to find a Java clock applet that will allow me to offset the
minutes. Ideally, something attractive, customizable, TZ-sensitive *AND*
with a minutes offset.

I've searched pretty thoroughly, but that last requirement doesn't seem to
exist in the online archives. (Note that I mean a real minutes offset, not
just a 0030 TZ offset - i.e., make the clock run exactly 10 minutes slow or
15 minutes fast.)

Oh, and something outta the box... I'm, uh, not a Java programmer. :P

Ad(thanks)vance.

|=-     James Gifford = FIX SPAMTRAP TO REPLY     -=|
|=- So... your philosophy fits in a sig, does it? -=|
John B. Matthews - 01 Aug 2005 02:02 GMT
> I'm trying to find a Java clock applet that will allow me to offset the
> minutes. Ideally, something attractive, customizable, TZ-sensitive *AND*
[quoted text clipped - 8 lines]
>
> Ad(thanks)vance.

Have a look at this applet; it's usually included with the JDK:

http://java.sun.com/products/plugin/1.4.2/demos/plugin/applets/Clock/Cloc
k.java

In method update, after "currentDate = new Date();" add

       long t = currentDate.getTime();
       t = t - 10 * 60 * 1000; // 10 minutes slow
       currentDate.setTime(t);

Adding an adjustable offset to the user interface will be your next
task:-)

Signature

John
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/

James Gifford - 01 Aug 2005 02:37 GMT
> Have a look at this applet; it's usually included with the JDK:
>
> Adding an adjustable offset to the user interface will be your next
> task:-)

I don't need a user-adjustable offset; I just want a clock that will run
precisely 20 minutes ahead of the correct time. One hard-coded change is
enough.

I'll look at this one; thank.

|=-     James Gifford = FIX SPAMTRAP TO REPLY     -=|
|=- So... your philosophy fits in a sig, does it? -=|


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.