Interesting utility to convert java.util.Date to readable datetime


#1

When looking at logs, jobs, etc via cosole, the ‘started’ time is returned in milliseconds (java.util.Date) format. This is difficult to comprehend and not really meant for humans. However, I found this online utility to do just that for me. This is particularly useful if I have something like
x = runSomeJob() and I want to track it with regards to start time and end time, which is expressed in this millisecond notation.

https://www.fileformat.info/tip/java/date2millis.htm

Nice. Do we have any built-in types, methods that do the same thing?


#2

I recommend using DateTime.toString() which takes an optional format parameter.

If you would like to learn more about the DateTime functions, check out the documentation under :your-server-name:/static/jsduck/index.html#!/api/DateTime