Java Timestamp Now getCurrentTimeStamp()

Here you can find the source of getCurrentTimeStamp()

Description

get Current Time Stamp

License

Open Source License

Declaration


public static Timestamp getCurrentTimeStamp() throws Exception 

Method Source Code


//package com.java2s;
import java.sql.Timestamp;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {

    public static Timestamp getCurrentTimeStamp() throws Exception {

        try {/*from ww w.  j  a  v a2s . c o m*/
            Calendar cal = new GregorianCalendar();
            Timestamp result = new Timestamp(cal.getTime().getTime());
            return result;
        } catch (Exception e) {
            throw new Exception("[DateUtil][getCurrentTimeStamp]" + e.getMessage(), e);
        }

    }
}

Related

  1. getCurrentDateTimestamp()
  2. getCurrentDBTimestamp()
  3. getCurrentSQLTimestamp()
  4. getCurrentSQLTimestamp()
  5. getCurrentTimeStamp()
  6. getCurrentTimeStamp()
  7. getCurrentTimestamp()
  8. getCurrentTimestamp()
  9. getCurrentTimestamp()