Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Time stamp format  RSS feed

 
munuswamy senthilkumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to get the timestamp in the following format yyyy-mm-dd-hh.mm.ss.SSnnnn
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37222
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Munuswamy,
Welcome to javaranch!

Take a look at the SimpleDateFormat class. It lets you customize the format of a date (timestamp is a subclass of date so it can do timestamps too.)
 
munuswamy senthilkumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get nano second.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!