知识点整理之Java时间格式化
Calendar rightNow = Calendar.getInstance();SimpleDateFormat formatNow = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss_SSSS");String nowStr = formatNow.format(rightNow.getTime());
以上代码把当前时间格式化为指定格式的字符串.