Two Laptop Bag*
The moose likes Java in General and the fly likes time pattern for milli second Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "time pattern for milli second" Watch "time pattern for milli second" New topic
Author

time pattern for milli second

S. Palanigounder
Ranch Hand

Joined: Apr 03, 2003
Posts: 145
To display milli seconds, What Should I put for milli seconds after seconds in the
time pattern HH:mm:ss??? Thanks.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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".


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
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


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: time pattern for milli second