Java SQL LocalDate transfer(java.util.Date date)

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

Description

transfer

License

Open Source License

Declaration

public static LocalDateTime transfer(java.util.Date date) 

Method Source Code


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

import java.sql.Timestamp;

import java.time.LocalDateTime;
import java.time.ZoneId;

public class Main {
    private static final ZoneId defaultZoneId = ZoneId.systemDefault();

    public static LocalDateTime transfer(Timestamp timestamp) {
        return timestamp == null ? null : LocalDateTime.ofInstant(timestamp.toInstant(), defaultZoneId);
    }//from   w  w  w  .  j  a va  2s .c  o  m

    public static LocalDateTime transfer(java.util.Date date) {
        return date == null ? null : LocalDateTime.ofInstant(date.toInstant(), defaultZoneId);
    }
}

Related

  1. toLocalDate(java.util.Date d)
  2. toSqlDate(Date d)
  3. toSQLDate(DateMidnight dm)
  4. toSqlDate(LocalDate ld)
  5. toSqlDateNoInicio(LocalDate data)