Java examples for java.util:Date Format
The following code shows how to mill Date Format.
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static void main(String[] argv) { long millis = 12312312312312342L; millDateFormat(millis);//from ww w .j a v a2s . c o m } public static void millDateFormat(long millis) { SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); Date date = new Date(millis); String time = format.format(date); System.out.println("time1:" + time); } }