Java SQL LocalDate toInstant(Date date)

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

Description

to Instant

License

Open Source License

Declaration

public static Instant toInstant(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.Date;
import java.time.Instant;

import java.time.ZoneOffset;

public class Main {
    public static Instant toInstant(Date date) {
        return date.toLocalDate().atStartOfDay(ZoneOffset.UTC).toInstant();
    }//  w w w  .  j  a  v  a2s  .c o m
}

Related

  1. getSqlDate(java.util.Date paramDate)
  2. setDate(PreparedStatement s, int col, LocalDate ld)
  3. toDate(LocalDate localDate)
  4. toDate(LocalDate localDate)
  5. toDate(LocalDate localDate)
  6. toJavaDate(DateMidnight dm)
  7. toJDBC(LocalDate fecha)
  8. toLocalDate(Date date)
  9. toLocalDate(Date date)