Android Second to Time getTimeForm(long milliseconds)

Here you can find the source of getTimeForm(long milliseconds)

Description

get Time Form

License

Open Source License

Declaration

public static String getTimeForm(long milliseconds) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

public class Main {

    public static String getTimeForm(long milliseconds) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(milliseconds);
        StringBuffer sb = new StringBuffer();
        sb.append(c.get(Calendar.YEAR)).append("-")
                .append(c.get(Calendar.MONTH) + 1).append("-")
                .append(c.get(Calendar.DAY_OF_MONTH)).append(" ")
                .append(c.get(Calendar.HOUR_OF_DAY)).append(":")
                .append(c.get(Calendar.MINUTE));
        return sb.toString();
    }/*w  ww .  j  av  a 2s  . c  o m*/
}

Related

  1. secondsToString(int seconds)
  2. intSecondsToStringMinSec(int input)
  3. getTimeRemaining(long durationInMilliseconds)
  4. timeRemaining(double seconds)
  5. getDfferenceInMinute(long miliseconds)
  6. milliSecondsToTimer(long milliseconds)
  7. getTime(int minutes, int seconds)
  8. getElapsedSeconds(long start, long end)
  9. getSpeedString(float bytesPerMillisecond)