#Date.toString()
will print the date in the local timezone.
Use SimpleDateFormat
to print the Date
formatted for a specific TimeZone
:
public static void main(String[] args) {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("E MMM dd HH:mm:ss:SS z");
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.println(format.format(date));
}