I have the following oql query running on visualvm against a heap dump and would like the creationTime
field formatted as a date time field (its stored as Long
).
select { id: s.id.toString(), createdAt: new Date(s.creationTime) }
from org.apache.catalina.session.StandardSession s
The above query lists the following output (snipped)
{
id = 1010827848,
createdAt = sun.org.mozilla.javascript.internal.NativeDate@66106135
}
...
So clearly its been "converted" into a Date but does not display it a human readable format. Doing a toString()
on the date object just results in the field being displayed as Invalid Date
.
- Is it possible to format the the Long field as a Date field?
- The id field's value also is off when queried using VisualVM. When I query the same heap dump using Eclipse Analyser I see the right value (which is
BE27C51E8BF185A2FB3AA9164EC0C647
). What could be happening to that?