Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

time pattern for milli second

 
S. Palanigounder
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To display milli seconds, What Should I put for milli seconds after seconds in the
time pattern HH:mm:ss??? Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bit of a vague question. I'm going to guess you mean by this "what pattern to I pass to the constructor of java.text.SimpleDateFormat to display the millisecond in a Date?" in which case a millisecond is represented by a capital "S".
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by S. Palanigounder:
To display milli seconds, What Should I put for milli seconds after seconds in the
time pattern HH:mm:ss??? Thanks.


In java document

S Millisecond Number


So you can use "S"

Example
"yyyy-MM-dd'T'HH:mm:ss.SSSZ" --> 2001-07-04T12:08:56.235-0700
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic