public static void main(String[] args) {
Calendar lastDate = Calendar.getInstance();
DateFormat gmtFormat = new SimpleDateFormat();
TimeZone gmtTime = TimeZone.getTimeZone("UTC");
gmtFormat.setTimeZone(gmtTime);
Calendar calendar=java.util.Calendar.getInstance();
System.out.println("GMT Time: " +calendar.getTime());
System.out.println("UTC Time: " +gmtFormat.format(calendar.getTime()));
}
Calendar lastDate = Calendar.getInstance();
DateFormat gmtFormat = new SimpleDateFormat();
TimeZone gmtTime = TimeZone.getTimeZone("UTC");
gmtFormat.setTimeZone(gmtTime);
Calendar calendar=java.util.Calendar.getInstance();
System.out.println("GMT Time: " +calendar.getTime());
System.out.println("UTC Time: " +gmtFormat.format(calendar.getTime()));
}