Java LocalDateTime Create getLocalDateTimeFromMillis(final long millis)

Here you can find the source of getLocalDateTimeFromMillis(final long millis)

Description

get Local Date Time From Millis

License

Open Source License

Parameter

Parameter Description
millis UTC-basierter Datum/Zeit-Wert in ms

Return

Datum/Zeit-Wert

Declaration

public static LocalDateTime getLocalDateTimeFromMillis(final long millis) 

Method Source Code

//package com.java2s;
/*/*w w  w  .ja v  a2  s .c om*/
 * Copyright 2014-2015 Christian Raue
 * MIT License http://opensource.org/licenses/mit-license.php
 */

import java.time.LocalDateTime;

import java.time.temporal.ChronoUnit;

public class Main {
    /**
     * @param millis UTC-basierter Datum/Zeit-Wert in ms
     * @return Datum/Zeit-Wert
     */
    public static LocalDateTime getLocalDateTimeFromMillis(final long millis) {
        return LocalDateTime.of(1970, 1, 1, 0, 0, 0).plus(millis, ChronoUnit.MILLIS);
    }
}

Related

  1. asLocalDateTime(Date date)
  2. asLocalDateTime(Date date)
  3. getLocalDateTime(Date datetime, TimeZone timeZone)
  4. getLocalDateTimeFromEpochMilli(long epochMillis)
  5. getLocalDateTimeFromMillis(long millis)
  6. localDateTime(Date date, Clock clock)
  7. localDateTimeOf(final String value)
  8. toLocalDateTime(java.util.Date d)