Here you can find the source of currentTimeStamp()
public static Timestamp currentTimeStamp()
//package com.java2s; /*/*from www . j av a 2 s . c o m*/ * This work is Open Source and licensed by the European Commission under the * conditions of the European Public License v1.1 * * (http://www.osor.eu/eupl/european-union-public-licence-eupl-v.1.1); * * any use of this file implies acceptance of the conditions of this license. * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ import java.sql.Timestamp; import java.util.GregorianCalendar; public class Main { /** * Generates the current timestamp. * * @return timestamp The current timestamp */ public static Timestamp currentTimeStamp() { final GregorianCalendar cal = new GregorianCalendar(); final long millis = cal.getTimeInMillis(); return new Timestamp(millis); } }