Quantcast
Channel: How to get current timestamp in string format in Java? "yyyy.MM.dd.HH.mm.ss" - Stack Overflow
Viewing all articles
Browse latest Browse all 12

Answer by dimoniy for How to get current timestamp in string format in Java? "yyyy.MM.dd.HH.mm.ss"

$
0
0

Use java.util.Date class instead of Timestamp.

String timeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date());

This will get you the current date in the format specified.


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>