How do I create a new Joda DateTime truncated to the last hour? [duplicate]
This question already has answers here : JodaTime equivalent of DateUtils.truncate() (4 answers) I am pulling timestamps from a file that I want to create a new DateTime for, but I want to create the DateTime at the floor of the hour (or any Joda Period will do). How Can I do this? Wohoo, found it. Simple like everything in Joda once I traced down the calls. DateTime dt = new DateTime().hourOfDay().roundFloorCopy(); 来源: https://stackoverflow.com/questions/1207957/how-do-i-create-a-new-joda-datetime-truncated-to-the-last-hour