Reputation: 17797
I can see how to convert from LocalDate
to epoch date, but how do I go the other way around?
That is, if I have the number of days from epoch, how can I construct org.joda.time.LocalDate
?
Upvotes: 0
Views: 2500
Reputation: 3848
Construct a new java.util.Date and then pass it to the LocalDate Constructor
Upvotes: 1
Reputation: 1503140
Simple:
// You'd probably make this a constant somewhere
LocalDate epoch = new LocalDate(1970, 1, 1);
LocalDate desiredDate = epoch.plusDays(daysSinceEpoch);
Upvotes: 3