Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.4k points)

What's the best way to get the current date/time in Java?

1 Answer

0 votes
by (46k points)

It's a very simple and useful task to perform, just use time.strftime().

from time import gmtime, strftime

strftime("%Y-%m-%d %H:%M:%S", gmtime())

'2019-28-06 03:11:05'

Happy Learning, Cheers. 

Related questions

Browse Categories

...