Java Millisecond Convert getTimeFromMillisAsNICSDate(long timeInMillis)

Here you can find the source of getTimeFromMillisAsNICSDate(long timeInMillis)

Description

get Time From Millis As NICS Date

License

Open Source License

Declaration

public static String getTimeFromMillisAsNICSDate(long timeInMillis) 

Method Source Code

//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;
    }
}

Related

  1. getNice(long timeMillisecGMT)
  2. getStringFromMillis(long timestamp)
  3. getTime(long millis)
  4. getTime(long time, boolean withMilliseconds)
  5. getTimeByMillis(long now)
  6. getTimeInMillisFromNicsDateString(String dateString)
  7. getTimeMillis(String dateStr)
  8. getTimeMillis(String time)
  9. getTimestamp(long milliseconds)