In a general case it's not as simple as it seems - Unix time defines a continuous timeline starting at 1970-01-01 00:00 UTC. LocalDate
is - as the name suggests - local to a certain place in the world. The beginning and end of the day 2015-01-01 is at a different point in time in Sydney than in Berlin. Also, Unix time involves time whereas LocalDate... not ;) So - if it indeed makes sense to convert a Local Date to a UTC timestamp there are two questions you must answer for yourself:
- in which time zone do you want to interpret the
LocalDate
?
- what should be the time part after the conversion?
Assuming it does make sense to do it and you can answer the questions, you can implement it using
LocalDate#toDateTime(LocalTime time, DateTimeZone zone)#getMillis()
or - if you want the start of the day
LocalDate#toDateTimeAtStartOfDay(DateTimeZone zone)#getMillis()