| | |
| | | /** DateFormat缓存 */ |
| | | private static Map<String, DateFormat> dateFormatMap = new HashMap<String, DateFormat>(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取DateFormat |
| | | * |
| | |
| | | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | Date newdate = new Date(); |
| | | SimpleDateFormat dft = new SimpleDateFormat("yyyyMMdd"); |
| | | String date = dft.format(newdate); |
| | | System.out.println(date); |
| | | // return endDate; |
| | | public static void main(String[] args) throws InterruptedException { |
| | | Date date1 = new Date(); |
| | | Thread.sleep(1000); |
| | | Date date2 = new Date(); |
| | | System.out.println(DateUtils.compareDateStr(date1,date2)); |
| | | } |
| | | } |