Results 1 to 1 of 1
-
How to use TimeZone class of java
This tip will show the use of TimeZone class to get the time in different time zone.
Java Code:import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.TimeZone; public class TimeZoneExp { public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("HHmmss"); TimeZone tz = TimeZone.getTimeZone("GMT"); Calendar day1 = Calendar.getInstance(tz); sdf.setTimeZone(tz); String resultTime = sdf.format(day1.getTime()); System.out.println(resultTime); } }
Similar Threads
-
converting jar to .class or .java
By marmara95 in forum New To JavaReplies: 12Last Post: 10-06-2012, 10:49 PM -
Java Calendar Class
By vasu18 in forum New To JavaReplies: 0Last Post: 12-06-2007, 10:45 AM -
Im new to java. how do i fix the problem with class
By lexlukkia in forum New To JavaReplies: 2Last Post: 11-18-2007, 04:47 AM -
How to accurately test if timezone data is updated?
By Santhosh in forum Advanced JavaReplies: 0Last Post: 11-14-2007, 06:53 AM -
Is there any utility that reads TimeZone data and display it in Human readable format
By Santhosh in forum Advanced JavaReplies: 0Last Post: 11-06-2007, 02:20 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks