Java中计算两个日期之间的天数,比如说2017/12/06与2017/12/04之间的天数差为2
1 | /** |
使用方式:
1 | SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); |
控制台将输出:
1 | days diff is : 2 |
参考link
1 | /** |
1 | SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); |
1 | days diff is : 2 |
参考link