Android examples for java.util:Date Format
Format date in long in yyyy-MM-dd format
import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main{ public static String getDay(long time) { return new SimpleDateFormat("yyyy-MM-dd").format(time); }//from ww w.j a v a 2 s . c o m }