Java Timestamp Create toSqlTimestamp(java.util.Date date)

Here you can find the source of toSqlTimestamp(java.util.Date date)

Description

to Sql Timestamp

License

Apache License

Declaration

public static java.sql.Timestamp toSqlTimestamp(java.util.Date date) 

Method Source Code

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

import java.time.Instant;

public class Main {
    public static java.sql.Timestamp toSqlTimestamp(java.util.Date date) {
        if (date == null) {
            return null;
        }/*from   ww  w .  j ava2s  .c om*/
        return toSqlTimestamp(date.getTime());
    }

    public static java.sql.Timestamp toSqlTimestamp(long time) {
        return new java.sql.Timestamp(time);
    }

    public static java.sql.Timestamp toSqlTimestamp(Instant instant) {
        if (instant == null) {
            return null;
        }
        return toSqlTimestamp(instant.toEpochMilli());
    }
}

Related

  1. toSqlTime(Timestamp timestamp)
  2. toSqlTimestamp(Date d)
  3. toSqlTimeStamp(Date d)
  4. toSQLTimestamp(Date date)
  5. toSQLTimestamp(DateTime dt)
  6. toSQLTimestamp(Object object, Object oDefault)
  7. toSQLTimestamp(String time)
  8. toTimestamp(BigDecimal value)
  9. toTimestamp(Date date)