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.*;

public class Main {

    public static Timestamp getTimestamp() {
        return new Timestamp(System.currentTimeMillis());
    }//w w w  .  j  a v a 2 s  .c  o m

    public static Timestamp getTimestamp(Date date) {
        return date == null ? null : new Timestamp(date.getTime());
    }
}

Related

  1. getDisplayTimeStamp(Date date)
  2. getJnlpTimestamp(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)