Android examples for java.util:Hour
get Current Hour End 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"); private final static SimpleDateFormat longSdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); public static Date getCurrentHourEndTime() { Date now = new Date(); try {/*from w w w . j ava 2 s.c o m*/ now = longSdf.parse(longHourSdf.format(now) + ":59:59"); } catch (Exception e) { e.printStackTrace(); } return now; } }