Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java clock

Status
Not open for further replies.

mike9606

Programmer
May 24, 2000
8
US
I'd like to display a clock on my website as a small graphic image showing the current time where i am. my web site is hosted on an american free server and i live in new zealand so i need to be able to set the time zone offset if i am required to source the time from the server and the clock needs to continuously update itself, i need to display the current hour and minute values<br><br>my experience with java is very limited so any help would be greatly appreciated
 
Dear Mike,<br><br>Take a look at the java.util.Calendar class, specifically check out:<br><br>public static synchronized Calendar getInstance( TimeZone zone ) <br><br>and / or<br><br>public static synchronized Calendar getInstance( Locale aLocale ) <br><br>after you have a locale specific instance check out the java.text.DateFormat class to produce your desired textual representation of the Date and Time.<br><br>Hope this helps<br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top