Here you can find the source of getTimeFromMillisAsNICSDate(long timeInMillis)
public static String getTimeFromMillisAsNICSDate(long timeInMillis)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; import org.joda.time.DateTime; public class Main { public static String getTimeFromMillisAsNICSDate(long timeInMillis) { SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); fmt.setTimeZone(TimeZone.getTimeZone("UTC")); return fmt.format(getDateFromMillis(timeInMillis)); }//from ww w .j a va 2s .c o m public static Date getDateFromMillis(long millis) { Date date = null; try { DateTime dt = new DateTime(millis); date = dt.toDate(); } catch (Exception e) { } return date; } }