Android examples for java.util:Hour
get Current Hour Start Time
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private final static SimpleDateFormat longHourSdf = new SimpleDateFormat( "yyyy-MM-dd HH"); public static Date getCurrentHourStartTime() { Date now = new Date(); try {//w w w . j a v a 2s. c o m now = longHourSdf.parse(longHourSdf.format(now)); } catch (Exception e) { e.printStackTrace(); } return now; } }