Studyon Minte9.com
Java SE




Timezone




package testexample; import java.util.*; import java.text.*; public class Test { public static void main(String[] args) { SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd_HHmmss"); format.setTimeZone(TimeZone.getTimeZone("Europe/Bucharest")); String currTime = format.format(Calendar.getInstance().getTime()); System.out.println(currTime); // Output: 20130123_095652 (2013:01:23 09:56:52) } }
 


http://stackoverflow.com/questions/2891361/java-how-to-set-timezone-of-a-java-util-date