As shown below: Copy the code code 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);