0 votes
1 view
in Java by (3.4k points)

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

1 Answer

0 votes
by (46.1k 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

0 votes
1 answer
0 votes
1 answer
asked Jul 29, 2019 in Java by Suresh (3.4k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...