public static int daydiff(Date fDate, Date oDate) { Calendar aCalendar = Calendar.getInstance(); aCalendar.setTime(fDate); int day1 = aCalendar.get(Calendar.DAY_OF_YEAR); aCalendar.setTime(oDate); int day2 = aCalendar.get(Calendar.DAY_OF_YEAR); retur…
<script src="Js/jquery-3.1.1.min.js"></script> <script type="text/javascript"> /* * 格式化金额 个位起每三位逗号分隔 10,000.00 * @param n 小数位 * @return */ String.prototype.toThousands = function (n) { var n = n > 0 && n &l…
日期的格式有很多形式,在使用过程中经常需要转换,下面是各种类型转换的使用例子以及日期计算方法的例子. 一.不同格式日期相互转换方法 public class TestDateConvertUtil { public static void main(String[] args) throws ParseException { // 获取当前时间 Date date = new Date(); // 获取当前时间 long timestamp = System.currentTimeMillis(…