34

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?

WolfmanDragon
  • 7,851
  • 14
  • 49
  • 61

1 Answers1

58

Wohoo, found it. Simple like everything in Joda once I traced down the calls.

DateTime dt = new DateTime().hourOfDay().roundFloorCopy();
WolfmanDragon
  • 7,851
  • 14
  • 49
  • 61