Java Data w UTC
OffsetDateTime now = OffsetDateTime.now(ZoneOffset.UTC);
System.out.println(now);
Gifted Grebe
OffsetDateTime now = OffsetDateTime.now(ZoneOffset.UTC);
System.out.println(now);
private static Date getCurrentUtcTime() throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
SimpleDateFormat localDateFormat = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss");
return localDateFormat.parse( simpleDateFormat.format(new Date()) );
}