Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joda time round to days

Tags:

java

jodatime

Basically what I need is round any date to days. For example: 2014-01-01 14:00:00 should be converted to 2014-01-01.

I was trying to achieve it using DateTimeFormatter but was not able to find a method which would return me an actual joda object but not a String.

like image 867
Wild Goat Avatar asked May 13 '14 09:05

Wild Goat


1 Answers

DateTime d = DateTime.now();
LocalDate ld = new LocalDate(d);

The local date will contain only year, month date

like image 73
Poorna Subhash Avatar answered Sep 30 '22 23:09

Poorna Subhash