Here you can find the source of getTodayTimestamp()
public static Timestamp getTodayTimestamp()
//package com.java2s; /*//from w ww. j a va 2 s . com * Copyright (c) Jim Coles (jameskcoles@gmail.com) 2018 through present. * * Licensed under the following license agreement: * * http://www.apache.org/licenses/LICENSE-2.0 * * Also see the LICENSE file in the repository root directory. */ import java.sql.*; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { /** * @return timestamp at midnight for current day (this is the very * beginning of a day NOT the end) */ public static Timestamp getTodayTimestamp() { Calendar cal = new GregorianCalendar(); cal.set(GregorianCalendar.HOUR, 0); cal.set(GregorianCalendar.HOUR_OF_DAY, 0); cal.set(GregorianCalendar.MINUTE, 0); cal.set(GregorianCalendar.SECOND, 0); cal.set(GregorianCalendar.MILLISECOND, 0); long todayInMillis = cal.getTime().getTime(); Timestamp ts = new Timestamp(todayInMillis); return ts; } }