I am currently using jodaTime DateTime class for my Java project. But it does not have support for quarter of the year and week of the year.
Is there any Java library which can be used for that purpose?
In java 8 DateTimeFormatter
supports quarters using q
format and week of the year using w
:
LocalDate date = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("qqq w");
String text = date.format(formatter);
Results in third quarter and 31st week of the year for todays date (July 25th):
"Q3 31"