Enterprise
Unix Timestamps in Java
Modern java.time.Instant and ZonedDateTime (Java 8+).
Complete Java Recipe
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
public class EpochExample {
public static void main(String[] args) {
// 1. Current timestamp
long currentSec = Instant.now().getEpochSecond();
long currentMs = System.currentTimeMillis();
// 2. Convert timestamp (1710000000) to Instant
Instant instant = Instant.ofEpochSecond(1710000000);
System.out.println(instant.toString()); // ISO 8601 UTC
// 3. Convert to specific timezone
ZonedDateTime zdt = instant.atZone(ZoneId.of("America/New_York"));
System.out.println(zdt.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
}
}
Test With Live Converter
Epoch → Human Date
Paste any Unix timestamp. The unit is auto-detected from its magnitude.
Auto-detects seconds, milliseconds, microseconds, or nanoseconds. Example: 1735689600
Detected:Auto (Seconds)
UTC ISO 8601
–
Local — auto
–
RFC 2822 / GMT
–
Seconds Value
–
Relative Time
–