import java.util.*;
import java.text.*;
public class Date1 {
public static void main(String args[]) {
/*try {
long start = System.currentTimeMillis( );//获取此刻时间
Thread.sleep(5*60*10);
//再次获取此刻的时间
System.currentTimeMillis()
long end = System.currentTimeMillis( );
//计算时间间隔
long interval = end - start;
System.out.println("interval is : " + interval);
} catch (Exception e) {
System.out.println("Got an exception!");
}
}*/
Date dNow = new Date();
SimpleDateFormat ft = new SimpleDateFormat("yyyy MM dd hh:mm:ss a zzz E");
System.out.println(ft.format(dNow));
}
}
时间: 2024-10-03 21:53:19