java - Get first and last day of month using threeten, LocalDate -
i have localdate needs first , last day of month. how do that?
eg. 13/2/2014 need 1/2/2014 , 28/2/2014 in localdate formats.
using threeten localdate class.
just use withdayofmonth
, , lengthofmonth()
:
localdate initial = localdate.of(2014, 2, 13); localdate start = initial.withdayofmonth(1); localdate end = initial.withdayofmonth(initial.lengthofmonth());
Comments
Post a Comment