public void start() {// make a new thread objectif (clockThread == null) {// pass it this object and a nameclockThread = new Thread(this, "Clock");// start the threadclockThread.start();running = true;}}

public void run() {// this method is called when the Thread manager// allows this thread some computing timewhile (running) {

The best way to do this would be to use DateFormat objects. Create one for UK, enter the time, take create a Date from that, then pass that Date to another DateFormat with the US time (I assume you want central time. Once you've got that done you can easily convert between any two timezones.

Posts:21 Registered: 11/17/03

Re: clocks Aug 2, 2004 2:52 PM (reply 2 of 4)

Could you please give me some pointers on how to create dateformat objects, thanks for your reply. isnt there a method where i could just do a sum and just add six hours using toUSTime(int currentTime) as a method? without using timezones?

thnaks

Posts:13,769 Registered: 00-11-29

Re: clocks Aug 2, 2004 3:01 PM (reply 3 of 4)

Could you please give me some pointers on how tocreate dateformat objects, thanks for your reply. isntthere a method where i could just do a sum and justadd six hours using toUSTime(int currentTime) as amethod? without using timezones?

thnaks

Sure. But why go through the effort to get something that is less useful?

Use the Calendar.add() method for that kind of thing.

Otherwise look at the SimpleDateFormat class.

Posts:37,103 Registered: 3/30/99

Re: clocks Aug 2, 2004 3:06 PM (reply 4 of 4)

1) Please don't crosspost. It cuts down on the effectiveness of responses, leads to people wasting their time answering what others have already answered, makes for difficult discussion, and is generally just annoying and bad form.

2) When you post code, please use [code] and [/code] tags as described in [url=http://forum.java.sun.com/features.jsp#Formatting]Formatting Help[/url] on the message entry page. It makes it much easier to read.