Java LocalDateTime Calculate ms2LocalDateTime(final long ms)

Here you can find the source of ms2LocalDateTime(final long ms)

Description

ms -> LocalDateTime object.

License

Open Source License

Parameter

Parameter Description
ms millisecond

Return

LocalDateTime

Declaration

public static LocalDateTime ms2LocalDateTime(final long ms) 

Method Source Code


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

import java.time.Instant;

import java.time.LocalDateTime;

import java.time.ZoneId;

public class Main {
    /**/*from  ww  w .j  a v  a  2s  .  co m*/
     * ms -> LocalDateTime object.
     * @param ms millisecond
     * @return LocalDateTime
     */
    public static LocalDateTime ms2LocalDateTime(final long ms) {
        return LocalDateTime.ofInstant(Instant.ofEpochMilli(ms), ZoneId.systemDefault());
    }
}

Related

  1. isToday(LocalDateTime dateTime)
  2. isTodayOrYesterday(LocalDateTime date)
  3. isWithin(LocalDateTime start, LocalDateTime end)
  4. last(LocalDateTime from, int dayOfWeek)
  5. localDateTime2LocalDate(LocalDateTime localDateTime)
  6. oldDateToISO8601LocalDateTime(Date nextColumnDate)
  7. parseStringToLocalDateTimeWithSpecifiedTime(String strDate, String time)
  8. parseTimeStamp(LocalDateTime actualDate, LocalDateTime checkedDate, boolean isDateFrom)
  9. printDateTime(LocalDateTime dateTime)