Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
Date and Time
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.Date; import java.text.SimpleDateFormat; import java.util.TimeZone; class Rextester { public static void main(String[] args) { //"hh" in pattern is for 12 hour time format and "aa" is for AM/PM SimpleDateFormat dateTimeInGMT = new SimpleDateFormat("yyyy-MMM-dd hh:mm:ss aa"); //Setting the time zone dateTimeInGMT.setTimeZone(TimeZone.getTimeZone("GMT")); System.out.println(dateTimeInGMT.format(new Date())); } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
pass
Max palindrome string
Equal_HashCode_TEST --- imporatnt concept about hashing
Abstract Inner Class
Find Median in Large File of Integers
wall-now
Array - char
쓰레드 critical section
fb_series
teat2
Please log in to post a comment.