This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: time pattern for milli second
 
Similar Threads
how to use System.currentTimeMillis() to check time for every 10 milli seconds?
EJB 2.1 MDB polling interval
Difference between '+' and concat in string
JCE Code
Problem with WAS 6.1