Java LocalDate Calculate dateToSystemLocalDate(Date d)

Here you can find the source of dateToSystemLocalDate(Date d)

Description

Takes a java.util.Date and turns it into a LocalDate based on the systems default timezone.

License

Open Source License

Parameter

Parameter Description
d a parameter

Exception

Parameter Description
Exception an exception

Declaration

public static LocalDate dateToSystemLocalDate(Date d) throws Exception 

Method Source Code


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

import java.time.*;

import java.util.Date;

public class Main {
    /**/*from  ww  w  . j  a  v a  2s  .  co  m*/
     * Takes a java.util.Date and turns it into a LocalDate based on the
     * systems default timezone.
     *
     * @param d
     * @return
     * @throws Exception
     */
    public static LocalDate dateToSystemLocalDate(Date d) throws Exception {
        return d.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
    }
}

Related

  1. changeDateToLocalDate(Date value)
  2. convert(LocalDate ld)
  3. convertDatabaseDateToUS(LocalDate databaseDate)
  4. converterToLocalDate(final String date)
  5. convertLocalDateToDatabaseDateString(LocalDate localDate)
  6. daysAgo(LocalDate pastDate)
  7. doy(LocalDate date)
  8. fastDateWrite(LocalDate localDate)
  9. fastDateWriteWeeks(LocalDate localDate)