1、时间戳转换为date
long sjc=1442633777; SimpleDateFormat t = new SimpleDateFormat("yyyyMMddHHmmss"); String date = t.format(new Date(sjc*1000)); System.out.println(date);
2、date转换为时间戳
SimpleDateFormat simpleDateFormat =new SimpleDateFormat("yyyyMMddHHmmss"); Date date=simpleDateFormat .parse("20150919102427"); long timeStemp = date.getTime(); System.out.println(timeStemp );
时间: 2024-10-09 14:15:23