Java Timestamp getCurTimestamp()

Here you can find the source of getCurTimestamp()

Description

get Cur Timestamp

License

Apache License

Declaration

public static Timestamp getCurTimestamp() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final SimpleDateFormat formatTimestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static Timestamp getCurTimestamp() {
        return Timestamp.valueOf(formatTimestamp.format(new Date()));
    }/*from   ww w  . jav a2 s  . c om*/
}

Related

  1. getCalendarTimestamp(Calendar cal)
  2. getCurentTimestamp()
  3. getCurFullTimestampStr()
  4. getCurrTimestamp()
  5. getCurTime2Timestamp()
  6. getCurTimestamp()
  7. getTimeDifference(Timestamp startTime, Timestamp endTime)
  8. getTimeFromTimestamp( java.sql.Timestamp tsZeitpunkt)
  9. getTimeNanoSec(Timestamp t)