Ask Your Question
0

Convert to date string - record:errorTime()

asked 2018-09-26 09:36:41 -0500

KRT gravatar image

Error function - record:errorTime() The time the record was sent to error. Return type: Long.

If I use record:errorTime(), the return value something like '1537539772693'. How can I convert the long date to string format, something like 'dd-mm-yyyy hh:mm:ss'

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-09-26 10:24:04 -0500

iamontheinet gravatar image

updated 2018-09-26 10:32:45 -0500

Hi!

This should work ${time:extractStringFromDate(time:millisecondsToDateTime(record:errorTime()),'dd-MM-yyyy hh:mm:ss')}.

For more details on Time based functions, refer to the docs.

Cheers, Dash

edit flag offensive delete link more

Comments

Getting error - CTRCMN_0100 - Error evaluating expression ${time:extractStringFromDate(record:errorTime(),'dd-MM-yyyy hh:mm:ss')}: javax.servlet.jsp.el.ELException: Attempt to coerce a value of type "java.lang.Long" to type "java.util.Date"

KRT gravatar imageKRT ( 2018-09-26 10:30:01 -0500 )edit

I've updated my answer to first convert time in milliseconds to Date.

iamontheinet gravatar imageiamontheinet ( 2018-09-26 10:33:51 -0500 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2018-09-26 09:36:41 -0500

Seen: 25 times

Last updated: Sep 26