Java Millisecond Convert millisecondToDate(long timeMillis)

Here you can find the source of millisecondToDate(long timeMillis)

Description

millisecond To Date

License

Apache License

Declaration

public static String millisecondToDate(long timeMillis) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    public static String millisecondToDate(long timeMillis) {
        if (timeMillis <= 0)
            return "";
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(timeMillis);
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        return dateFormat.format(calendar.getTime());

    }/*from ww w .  ja v  a2 s .  c  om*/
}

Related

  1. millisecondsToString(long milliseconds)
  2. millisecondsToString(long time)
  3. millisecondsToTimerString(long millis)
  4. millisecondsToTimestamp(final long milliseconds)
  5. millisecondsToTimeString(int milliseconds)
  6. millisecondToDate(String str)
  7. millisecondToDHMS(long duration)
  8. millisecsToSecs(long millisecs)
  9. milliSecsToTime(double current, double max, double buffer)