日期:2014-05-20 浏览次数:20775 次
package test;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateTest {
/**
* @param args
* @throws ParseException
*/
public static void main(String[] args) throws ParseException {
// TODO Auto-generated method stub
SimpleDateFormat simFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
Date dateC = simFormat.parse("2013.03.28 00:00:00");
int dateCDays = (int) Math.abs(dateC.getTime()/(24*60*60*1000));
System.out.println("dateC is " + dateCDays);
System.out.println(dateC.getTime());
float dateCTime = dateC.getTime();
System.out.println(dateCTime/(24*60*60*1000));
}
}