问题描述:

I would like to have this nested within an ajax call. I am getting microseconds since epoch as the format on an api response and need it to display in a standard date format.

I found this code for millisecond, can I convert this to microseconds?

long millisecondsSinceEpoch = 1486132645639000;

Instant instant = Instant.ofEpochMicro ( millisecondsSinceEpoch );

ZonedDateTime zdt = ZonedDateTime.ofInstant ( instant , ZoneOffset.UTC );

DateTimeFormatter formatter = DateTimeFormatter.ofPattern ( "HH:mm:ss:SSS" );

String output = formatter.format ( zdt );

System.out.println ( "millisecondsSinceEpoch: " + millisecondsSinceEpoch + " instant: " + instant + " output: " + output );

What would be the best way to nest this within this call?

$.ajax({

type: 'GET',

url: https://avacmd25.scala.com:44335/ContentManager/api/rest/heartbeats/sequence/'+(item.uuid),

dataType: "json",

crossDomain: true,

})

Any help is appreciated. Thanks.

相关阅读:
Top