Java LocalDateTime to millisToLocalDateTime(Long inMillis)

Here you can find the source of millisToLocalDateTime(Long inMillis)

Description

millis To Local Date Time

License

Open Source License

Declaration

public static LocalDateTime millisToLocalDateTime(Long inMillis) 

Method Source Code

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

import java.time.LocalDateTime;

import java.time.ZoneId;

import java.util.Date;

public class Main {
    public static LocalDateTime millisToLocalDateTime(Long inMillis) {
        return millisToLocalDateTime(inMillis, ZoneId.systemDefault());
    }//w w w.ja  va 2 s .co m

    public static LocalDateTime millisToLocalDateTime(Long inMillis, ZoneId inZoneId) {

        if (inMillis == null) {
            inMillis = System.currentTimeMillis();
        }
        if (inZoneId == null) {
            inZoneId = ZoneId.systemDefault();
        }

        return LocalDateTime.ofInstant(new Date(inMillis).toInstant(), inZoneId);
    }
}

Related

  1. localDateTimeToEpochMillis(TemporalAccessor temporal)
  2. localDateTimeToString(LocalDateTime value)
  3. localDateTimeToTimestamp(LocalDateTime ldt)
  4. longTOLocalDateTime(long minDate)
  5. luisDate(LocalDateTime date)
  6. toDate(LocalDateTime dateTime)
  7. toDate(LocalDateTime ldt)
  8. toDateHeader(LocalDateTime dt)
  9. toDateUTCFromJST(LocalDateTime dateTime)