import java.text.SimpleDateFormat;
import java.util.Date;
public class T {
public static void main(String[] args) throws Exception {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long timeStart=sdf.parse("2011-09-20 12:30:45").getTime();
System.out.println(timeStart);//date——>long
Date date = new Date(timeStart);
System.out.println(sdf.format(date));//long——>date
}
}

 

相关文章:

  • 2022-12-23
  • 2022-01-11
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-22
  • 2021-05-18
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
相关资源
相似解决方案