EN
Java - timestamp milliseconds to microseconds
7
points
Quick solution:
import java.sql.Timestamp;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
public class Example {
public static void main(String[] args) {
Timestamp timestamp = new Timestamp(1631189155668L);
System.out.println("1) " + timestamp.getTime());
System.out.println("2) " + timestamp.getTime() * 1000);
System.out.println("3) " + ChronoUnit.MICROS.between(Instant.EPOCH, timestamp.toInstant()));
// 1) 1631189155668
// 2) 1631189155668000
// 3) 1631189155668000
}
}