SyntaxFix
Write A Post
Hire A Developer
Questions
final Date currentTime = new Date(); final SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss a z"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); System.out.println("UTC time: " + sdf.format(currentTime));