EN
Java - convert Timestamp to Instant
4
points
Quick solution:
import java.sql.Timestamp;
import java.time.Instant;
public class Example {
public static void main(String[] args) {
Timestamp timestamp = new Timestamp(1631189155668L);
Instant instant = timestamp.toInstant();
System.out.println(instant); // 2021-09-09T12:05:55.668Z
}
}