Return a Timestamp for right now - Java java.sql

Java examples for java.sql:Timestamp

Description

Return a Timestamp for right now

Demo Code


//package com.java2s;

public class Main {
    /**//w  ww . j ava 2s.  c o m
     * Return a Timestamp for right now
     * 
     * @return Timestamp for right now
     */
    public static java.sql.Timestamp nowTimestamp() {
        return new java.sql.Timestamp(System.currentTimeMillis());
    }
}

Related Tutorials