// Java:
long timeMs = System.currentTimeMillis();
System.out.println("long = " + timeMs);
// current time zone
SimpleDateFormat default = new SimpleDateFormat("yyyy-MM-dd HH:mm");
System.out.println(default.format(timeMs));
// +8:00 time zone
SimpleDateFormat chinaFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
chinaFormat.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
System.out.println("GMT+8:00 = " + chinaFormat.format(timeMs));
// +5:30 time zone
SimpleDateFormat indiaFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
indiaFormat.setTimeZone(TimeZone.getTimeZone("GMT+5:30"));
System.out.println("GMT+5:30 = " + indiaFormat.format(timeMs));