Menu

#1 nanoseconds are lost during SampleDateFormat

v2.3.7
open
nobody
None
5
2003-07-17
2003-07-17
Radu Marian
No

When the following method is called:
com.framework.misc.Utility.formatTimestampToString
(aTimestamp, "yyyy-MM-dd kk:mm:ss.SSS")

SimpleDateFormat is used to format a the passed in
Timestamp. However during the format() method call
timestamp implicitly gets casted into java.util.Date and
as a result one gets '000' all the time for nanoseconds.

I have a work around. How do I contribute?

P.S. Do you guys need to create a new category called
misc or utilities?

Discussion


Log in to post a comment.