Created
March 27, 2015 09:34
-
-
Save oxpa/276cc6503dcfdab47ec3 to your computer and use it in GitHub Desktop.
a test class to verify tz update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.text.*; | |
public class Time { | |
public static void main(String[] args) { | |
Date date = new Date(); | |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
String zone = TimeZone.getDefault().getID(); | |
df.setTimeZone(TimeZone.getDefault()); | |
System.out.println("Date and time in " + zone + ": " + df.format(date)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment