29 lines
803 B
Java
29 lines
803 B
Java
package com.thinker.bishi.saima;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Scanner;
|
|
|
|
/**
|
|
* @author lzh
|
|
* <p href="http://exercise.acmcoder.com/online/online_judge_ques?ques_id=1649&konwledgeId=134">
|
|
* http://exercise.acmcoder.com/online/online_judge_ques?ques_id=1649&konwledgeId=134
|
|
* </p>
|
|
*/
|
|
public class DiffDate {
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
Scanner sc = new Scanner(System.in);
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
Date date = df.parse(sc.nextLine());
|
|
Date now = df.parse("2015-10-18");
|
|
long l = date.getTime() - now.getTime();
|
|
long day = l / (24 * 60 * 60 * 1000);
|
|
System.out.println(day);
|
|
}
|
|
|
|
|
|
}
|