Joda DateTime to Unix DateTime
问题 It's odd enough, but I didn't find any result about converting Joda(Time) DateTime to Unix DateTime (or timestamp, whichever is the correct name). How can I do this? 回答1: Any object that inherits from BaseDateTime (including DateTime ) has the method public long getMillis() According to the API it: Gets the milliseconds of the datetime instant from the Java epoch of 1970-01-01T00:00:00Z. So a working example to get the seconds would simply be: new DateTime().getMillis() / 1000 For