2012-08-12 35 views

回答

1
SimpleDateFormat dmy = new SimpleDateFormat("dd/MM/yyyy"); 
dmy.format(d); 
1

使用SimpleDateFormat

import java.util.*; 
import java.text.*; 
Date dNow = new Date(); 
SimpleDateFormat ft = new SimpleDateFormat ("d/m/y"); 
System.out.println("Current Date: " + ft.format(dNow)); 

或者使用printf

System.out.printf("%n/%d/%y", dNow); 
0

61304700000000你在屏幕上什麼是64位長的值從1月1日開始,1970年

如果你這樣做......

Date d = new Date(61304700000000L); 
System.out.println(d); 

輸出:

Mon Sep 02 08:50:00 IST 3912 

這樣做得到day/Month/Year(例如:00/00/0000)

System.out.println(new SimpleDateFormat("dd/MM/YYYY").format(new Date()));