- Related Questions & Answers
- How to get the number of seconds between two Dates in JavaScript?
- How to get the number of days between two Dates in JavaScript?
- How do I get the number of days between two dates in JavaScript?
- Finding Number of Days Between Two Dates JavaScript
- How to get the differences between two dates in iOS?
- How to get the difference between two dates in Android?
- How to count days between two dates in Java
- Find the number of logins between two dates in MySQL
- Find number of days between two given dates in C++
- C# Program to get the difference between two dates
- Java Program to get milliseconds between dates
- How to find the number of days and number of weeks between two dates in R?
- Get the SUM of records between two given dates in MySQL
- How to get the differences between two dates in Android using Kotlin?
- How do I calculate number of days between two dates using Python?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Let’s say we have the following two dates −

LocalDate.of(2019, 3, 20); LocalDate.of(2019, 10, 25);

To get the number of quarters between the above two dates, use the QUARTER_YEARS −

IsoFields.QUARTER_YEARS.between(LocalDate.of(2019, 3, 20),LocalDate.of(2019, 10, 25));

import java.time.LocalDate; import java.time.temporal.IsoFields; public class Demo { public static void main(String[] args) { long quarters = IsoFields.QUARTER_YEARS.between(LocalDate.of(2019, 3, 20), LocalDate.of(2019, 10, 25)); System.out.println("Quarters between the two dates = " + quarters); } }

Quarters between the two dates = 2

Advertisements