Java clock offsettable by minutes?  
Author Message
James Gifford





PostPosted: 2005-8-1 4:39:00 Top

java-programmer, Java clock offsettable by minutes? 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





PostPosted: 2005-8-1 9:03:00 Top

java-programmer >> Java clock offsettable by minutes? In article <email***@***.com>,
James Gifford <email***@***.com> wrote:

> 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.

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:-)

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





PostPosted: 2005-8-1 9:38:00 Top

java-programmer >> Java clock offsettable by minutes? "John B. Matthews" <email***@***.com> wrote:
> 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? -=|