Java timestamp to date format implementation code

  • 2020-04-01 02:06:56
  • OfStack

As follows:


String beginDate="1328007600000";
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
String sd = sdf.format(new Date(Long.parseLong(beginDate)));
System.out.println(sd);


Related articles: