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.
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
Post a Comment