Back
What's the best way to get the current date/time in Java?
It's a very simple and useful task to perform, just use time.strftime().
from time import gmtime, strftimestrftime("%Y-%m-%d %H:%M:%S", gmtime())'2019-28-06 03:11:05'
from time import gmtime, strftime
strftime("%Y-%m-%d %H:%M:%S", gmtime())
'2019-28-06 03:11:05'
Happy Learning, Cheers.
30.9k questions
32.9k answers
500 comments
665 users