java - Convert Joda LocalDate to Unix Epoch Time -


i'm looking convert joda localdate unix epoch time (long) in java.

i've looked in localdate documentation , there doesn't appear on getting value.

link

i'm new joda , have been searching around , haven't found right way of doing yet. know has easy haven't figured out. appreciated.

in general case it's not simple seems - unix time defines continuous timeline starting @ 1970-01-01 00:00 utc. localdate - name suggests - local place in world. beginning , end of day 2015-01-01 @ different point in time in sydney in berlin. also, unix time involves time whereas localdate... not ;) - if indeed makes sense convert local date utc timestamp there 2 questions must answer yourself:

  • in time zone want interpret localdate?
  • what should time part after conversion?

assuming make sense , can answer questions, can implement using

localdate#todatetime(localtime time, datetimezone zone)#getmillis() 

or - if want start of day

localdate#todatetimeatstartofday(datetimezone zone)#getmillis() 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -