Java Timestamp Now currentTimestamp()

Here you can find the source of currentTimestamp()

Description

current Timestamp

License

Apache License

Declaration

public static Timestamp currentTimestamp() 

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 SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");

    public static Timestamp currentTimestamp() {
        return new Timestamp(new Date().getTime());
    }//  ww  w.  ja  v  a  2 s .  com

    public static String getTime(String pattern) {
        return new SimpleDateFormat(pattern).format(new Date());
    }
}

Related

  1. currentTimeStamp()
  2. currentTimeStamp()
  3. currentTimeStamp()
  4. currentTimestamp()
  5. currentTimestamp()
  6. currentTimestamp2String(String pattern)
  7. currentTimestampPlus(final long seconds)
  8. generateTimestamp()
  9. generateTimeStamp()