Java Timestamp Now getCurrentTimeStamp(String format)

Here you can find the source of getCurrentTimeStamp(String format)

Description

get Current Time Stamp

License

Open Source License

Declaration

public static String getCurrentTimeStamp(String format) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Timestamp getCurrentTimestamp() {
        return new Timestamp(System.currentTimeMillis());
    }/*w w  w .  j a v  a2  s.  c  o  m*/

    public static String getCurrentTimeStamp(String format) {
        SimpleDateFormat f = new SimpleDateFormat(format);
        String timeStamp = f.format(new Date());
        return timeStamp;
    }
}

Related

  1. getCurrentTimestamp()
  2. getCurrentTimestamp()
  3. getCurrentTimeStamp()
  4. getCurrentTimeStamp()
  5. getCurrentTimeStamp(int offsetDays)
  6. getCurrentTimestampAsString()
  7. getNowTimeStamp()
  8. getTimeStamp()
  9. getTimestamp()