Skip to content

Instantly share code, notes, and snippets.

@oxpa
Created March 27, 2015 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxpa/276cc6503dcfdab47ec3 to your computer and use it in GitHub Desktop.
Save oxpa/276cc6503dcfdab47ec3 to your computer and use it in GitHub Desktop.
a test class to verify tz update
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