Here you can find the source of getDatebyLong(long dt)
public static String getDatebyLong(long dt)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getDatebyLong(long dt) { Date date = new Date(dt); return formatDate(date, "yyyy-MM-dd"); }//from w w w.ja v a 2s. c o m public static String formatDate(Date date, String formatGeshi) { SimpleDateFormat format = new SimpleDateFormat(formatGeshi); return format.format(date); } }