Here you can find the source of generateTimestamp()
public static Timestamp generateTimestamp()
//package com.java2s; /*/*from w ww.j av a2 s .com*/ * Copyright 2003, 2004, 2005, 2006 Research Triangle Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 */ import java.sql.Timestamp; public class Main { /** * Generate timestamp. * @return timestamp */ public static Timestamp generateTimestamp() { java.sql.Timestamp now = new java.sql.Timestamp(System.currentTimeMillis()); return now; } }