Here you can find the source of roundToSecond(Timestamp t)
public static Timestamp roundToSecond(Timestamp t)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.sql.Timestamp; public class Main { public static Timestamp roundToSecond(Timestamp t) { return new Timestamp((t.getTime() / 1000) * 1000); }/*from w w w.j av a 2s .c om*/ }