March 9th, 2004, 9:06 pm
Will this help: Date d = (Calendar.getInstance()).getTime(); // Gives the current datetime for the default timezone.SimpleDateFormat ds = new SimpleDateFormat("MMM dd yyyy hh:mm:ss:SSSaa"); // Create a datetime format ds.setTimeZone(TimeZone.getTimeZone("GMT")); // Sets the timezone of the datetime format object to GMTString time = ds.format(d); ds.setTimeZone(TimeZone.getDefault()); // Set the timezone back to its original default value.If you observe, date object is the same but the way you show or read differs depending on the TimeZone you set to your datetime format object.Hope this helps.--Zooey