Print Timestamp in Java
You can use the System.currentTimeMillis() method to obtain the current timestamp and use the System.out.println() method to print it. Here is an example code:
public class Main {
public static void main(String[] args) {
long timestamp = System.currentTimeMillis();
System.out.println("当前时间戳:" + timestamp);
}
}
When you execute this code, it will print out the current timestamp.