?? 例7-1.txt
字號(hào):
import java.util.Date;
import java.text.SimpleDateFormat;
public class Example7_1{
public static void main(String args[ ]){
Date nowTime=new Date();
System.out.println("現(xiàn)在的時(shí)間:"+nowTime);
SimpleDateFormat matter1=new SimpleDateFormat(" 'BeijingTime':yyyy-MM-dd");
System.out.println("現(xiàn)在的時(shí)間:"+matter1.format(nowTime));
SimpleDateFormat matter2=
new SimpleDateFormat("北京時(shí)間yyyy-MM-dd HH:mm:ss(a)(EE)");
System.out.println("現(xiàn)在的時(shí)間:"+matter2.format(nowTime));
long time=-1000L;
Date date=new Date(time);
System.out.println(time+"秒表示的日期時(shí)間是:"+matter2.format(date));
time=1000L;
date=new Date(time);
System.out.println(time+"秒表示的日期時(shí)間是:"+matter2.format(date));
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -