Java examples for java.time:LocalDateTime
get LocalDateTime From Timestamp
//package com.java2s; import java.time.Instant; import java.time.LocalDateTime; import java.util.TimeZone; public class Main { public static LocalDateTime getDateTimeFromTimestamp(long timestamp) { if (timestamp == 0) return null; return LocalDateTime.ofInstant(Instant.ofEpochSecond(timestamp), TimeZone.getDefault().toZoneId()); }//from w ww . j a v a 2 s . c o m }