
java
mr.tank
这个作者很懒,什么都没留下…
展开
-
java遍历父文件夹下所有文件
private static void getFolderFiles(String input_Path) throws Exception { // TODO Auto-generated method stub File file = new File(input_Path); File[] array = file.listFiles(); for (int i = 0; i转载 2015-11-04 19:02:22 · 287 阅读 · 0 评论 -
字符串转日期
//字符串按指定dateFormat转化为Date//dateFormat 为 "yy-MM-dd HH:mm:ss"等 public static Date strToDate(String str,String dateFormat) { SimpleDateFormat format = new SimpleDateFormat(dateFormat); Da转载 2015-11-04 18:50:03 · 327 阅读 · 0 评论 -
long转日期字符串
public static String long2DateString(long time) { String format = "yyyy-MM-dd HH:mm:ss"; SimpleDateFormat sf = new SimpleDateFormat(format); Date date = new Date(time); return sf.format(date);转载 2015-11-04 18:52:56 · 799 阅读 · 0 评论 -
判断星期
//判断星期几 public static String dayForWeek(String pTime) throws Exception { String formatPTime = pTime.substring(0, 4)+"-"+pTime.substring(4, 6)+"-"+pTime.substring(6, 8); SimpleDateFormat format转载 2015-11-04 18:55:37 · 296 阅读 · 0 评论 -
遍历Map
public static void printMap(Map map) { Set> entryseSet=map.entrySet(); for (Entry entry:entryseSet) { System.out.println(entry.getKey()+" "+entry.getValue()); } }转载 2015-11-04 18:59:40 · 282 阅读 · 0 评论