Android examples for java.util:Date
trim Seconds from Date and return the Date
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date trimSeconds(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date);//from w w w . j ava2 s . co m calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.SECOND, 0); return calendar.getTime(); } }