Android examples for java.util:Day
get Current Day Time
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy-MM-dd"); public static long getCurrentDayTime() { Date d = new Date(System.currentTimeMillis()); String formatDate = yearFormat.format(d); try {/* w w w .j a v a 2s. c o m*/ return (yearFormat.parse(formatDate)).getTime(); } catch (ParseException e) { e.printStackTrace(); } return 0; } }