Java Timestamp getCurTime2Timestamp()

Here you can find the source of getCurTime2Timestamp()

Description

get Cur Time Timestamp

License

Open Source License

Declaration

public static Timestamp getCurTime2Timestamp() throws ParseException 

Method Source Code


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

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {

    public static Timestamp getCurTime2Timestamp() throws ParseException {
        Timestamp t = new Timestamp(System.currentTimeMillis());
        String d2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(t);
        Timestamp.valueOf(d2);// w w w. ja  v  a 2  s . co m
        return t;
    }
}

Related

  1. getBeforeDate(final Timestamp baseTime, final int period, final int unit)
  2. getCalendarTimestamp(Calendar cal)
  3. getCurentTimestamp()
  4. getCurFullTimestampStr()
  5. getCurrTimestamp()
  6. getCurTimestamp()
  7. getCurTimestamp()
  8. getTimeDifference(Timestamp startTime, Timestamp endTime)
  9. getTimeFromTimestamp( java.sql.Timestamp tsZeitpunkt)