Here you can find the source of timeLongToHhmm(long timeMillis, DateFormat df)
public static String timeLongToHhmm(long timeMillis, DateFormat df)
//package com.java2s; /*//from w w w . ja v a 2s .c o m Copyright (C) 2011 Green Soybean Technologies, LLC <edamametech@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. */ import java.text.DateFormat; import java.util.Date; public class Main { public static String timeLongToHhmm(long timeMillis, DateFormat df) { Date d = new Date(timeMillis); return df.format(d); } }