Java Date to Timestamp DateToTimestamp(Date time)

Here you can find the source of DateToTimestamp(Date time)

Description

Date To Timestamp

License

Open Source License

Declaration

public static Integer DateToTimestamp(Date time) 

Method Source Code


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

import java.util.Date;

public class Main {

    public static Integer DateToTimestamp(Date time) {
        Timestamp ts = new Timestamp(time.getTime());

        return (int) ((ts.getTime()) / 1000);
    }//w w w.ja  v a2s .c  o  m
}

Related

  1. dateToTimestamp(Date date)
  2. dateToTimestamp(Date date)
  3. dateToTimestamp(Date date)
  4. dateToTimestamp(Date date)
  5. dateToTimestamp(Date date)
  6. dateToTimestamp(java.util.Date d)
  7. dateToTimeStamp(java.util.Date date)
  8. dateToTimestamp(java.util.Date date)
  9. escapeAsTimestamp(Date date)