tl;dr
OffsetDateTime.of( 2000 , 1 , 1 , 0 , 0 , 0 , 0 , ZoneOffset.UTC ) // Define your epoch reference moment.
.pluSeconds( yourSeconds ) // Add the number of seconds given to you. Returns another `OffsetDateTime` object rather than altering the original (immutable objects pattern).
.toLocalDate() // Extract a date-only value without time-of-day and without offset-from-UTC.
java.time
Use the modern java.time classes that supplanted the terrible old legacy classes such as Date
& Calendar
.
Instant
An Instant
represents a moment in UTC.
Define your particular epoch reference date-time.
Instant epoch = Instant.parse( "2000-01-01T00:00Z" ) ;
Add your number of seconds.
Instant later = epoch.plusSeconds( yourSecondsGoHere ) ;
OffsetDateTime
If you want a date-only value without time-of-day and without time zone, use LocalDate
class. First, convert from the basic type Instant
to the more flexible OffsetDateTime
, specifying the constant ZoneOffset.UTC
as the offset.
OffsetDateTime odt = instant.atOffset( ZoneOffset.UTC ) ;
LocalDate
Extract the date-only value.
LocalDate ld = odt.toLocalDate() ;

About java.time
The java.time framework is built into Java 8 and later. These classes supplant the troublesome old legacy date-time classes such as java.util.Date
, Calendar
, & SimpleDateFormat
.
The Joda-Time project, now in maintenance mode, advises migration to the java.time classes.
To learn more, see the Oracle Tutorial. And search Stack Overflow for many examples and explanations. Specification is JSR 310.
You may exchange java.time objects directly with your database. Use a JDBC driver compliant with JDBC 4.2 or later. No need for strings, no need for java.sql.*
classes.
Where to obtain the java.time classes?

The ThreeTen-Extra project extends java.time with additional classes. This project is a proving ground for possible future additions to java.time. You may find some useful classes here such as Interval
, YearWeek
, YearQuarter
, and more.