主要介绍三种System.currentTimeMillis()、Date、LocalDateTime
public static void main(String[] args) {
LocalDateTime now = LocalDateTime.now();
System.out.println(System.currentTimeMillis());
System.out.println(new Date().getTime());
System.out.println(Timestamp.valueOf(now).getTime());
System.out.println(now.atZone(ZoneOffset.ofHours(8)).toInstant().toEpochMilli());
}