Skip to content
Advertisement

How to get current timestamp in string format in Java? “yyyy.MM.dd.HH.mm.ss”

How to get timestamp in string format in Java? “yyyy.MM.dd.HH.mm.ss”

JavaScript

This is what I have, but Timestamp() requires an parameters…

Advertisement

Answer

Replace

JavaScript

with

JavaScript

because there is no default constructor for Timestamp, or you can do it with the method:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement