Java Date to Timestamp getTimestamp(Date date)

Here you can find the source of getTimestamp(Date date)

Description

get Timestamp

License

Apache License

Declaration

public static Timestamp getTimestamp(Date date) 

Method Source Code

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

import java.sql.Timestamp;

import java.util.Date;

public class Main {

    public static Timestamp getTimestamp(long millis) {
        return new Timestamp(millis);
    }/*www  .  j  a  va 2 s.c  om*/

    public static Timestamp getTimestamp(String time) {
        return new Timestamp(Long.parseLong(time));
    }

    public static Timestamp getTimestamp() {
        return new Timestamp(new Date().getTime());
    }

    public static Timestamp getTimestamp(Date date) {
        return new Timestamp(date.getTime());
    }
}

Related

  1. getTimestamp(Date date)
  2. getTimestamp(Date date)
  3. getTimestamp(Date date)
  4. getTimestamp(Date date)
  5. getTimestamp(Date date)
  6. getTimestamp(Date date)
  7. getTimestamp(Date date)
  8. getTimestamp(Date date)
  9. getTimeStamp(Date date, String time)