Long a = 1447759915523l; SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date= new Date(a); String d = df.format(date); System.out.println("d = "+d); /*date转long*/ String dd = "2015-11-17 11:31:56"; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 2015-06-05 15:02:03 Date dt = sdf.parse(dd); long time = dt.getTime(); System.out.println("time = "+time);