Date formatting in Java


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Date d1 = new Date(long UnixTimestamp);
  2. SimpleDateFormat date_format = new SimpleDateFormat("MMM dd,yyyy HH:mm:ss");
  3. System.out.println(date_format.format(d1));

Report this snippet


Comments


You need to login to view comments.