title: applescript - How many days in a specific month (specified date)
body: <p>Overview</p>
  <ul>
  <li>I'm trying to provide a specified date and find out how many days are in that month.</li>
  <li>Found something close but it uses current date.  How do I modify the current date so it accepts it in the subroutine input below</li>
  </ul>
  <p>Desire:</p>
  <ul>
  <li>Get the Number of Days in a month from a specified date</li>
  <li>enter (MM/DD/YYYY) get the number of days</li>
  </ul>
  <p>Sample:</p>
  <pre><code>on GetNumberOfDaysInMonth(aDate)
      local aDateCopy
      copy aDate to aDateCopy
      set day of aDateCopy to 1
      if month of aDateCopy is December then
          set year of aDateCopy to ((year of aDateCopy) + 1)
          set month of aDateCopy to 1
      else
          set month of aDateCopy to ((month of aDateCopy) + 1)
      end if
      return day of (aDateCopy - 1 * days)
  end GetNumberOfDaysInMonth
  
  my GetNumberOfDaysInMonth(current date)
  </code></pre>