创建日期目录,,public stati
分享于 点击 6426 次 点评:82
创建日期目录,,public stati
public static void createDateDir(String rootpath){ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); Calendar c = Calendar.getInstance(); for (int i = 1; i < 50; i++) { c.add(Calendar.DAY_OF_MONTH, 1); String dateStr = sdf.format(c.getTime()); File f = new File(MessageFormat.format("{0}\\\\{1}", rootpath,dateStr)); boolean b = f.mkdir(); System.out.println(MessageFormat.format("create dir:{0} , 成功:{1}",f.getAbsoluteFile(),b)); } }//该片段来自于http://byrx.net
用户点评