title: How can I generate a quarterly date sequence in Java?
body: <p>I'm trying to create a function in Java that generates a quarterly date sequence, given a start and end date. </p>
  
  <p>In R, for example, I can do this as follows:</p>
  
  <pre><code>generateQuarterlySequence = function(startDate, endDate)
  {
    require(zoo)
  
    # Generate date sequence
    dateSequence = seq.Date(from = as.Date(startDate), 
                            to = as.Date(endDate), 
                            by = "quarter")
  
    # Convert to quarters
    dateSequence = as.yearqtr(dateSequence, format = "%Y-%m-%d") 
  
    # Get rid of extra white space
    dateSequence = gsub(" ", "", dateSequence) 
  
    return(dateSequence)
  
  }
  
  generateQuarterlySequence(startDate = "2017-06-30", endDate = "2017-12-31")
  [1] "2017Q2" "2017Q3" "2017Q4"
  </code></pre>
  
  <p>Any rock stars care to show how this is done in Java? You'd be making this Java beginner very happy!</p>
  
  <p>Cheers,
  Joe</p>