code: public Response setDates(String photoId, Date datePosted, Date dateTaken, int dateTakenGranularity) throws JinxException {
      JinxUtils.validateParams(photoId);
      Map<String, String> params = new TreeMap<>();
      params.put("method", "flickr.photos.setDates");
      params.put("photo_id", photoId);
      if (datePosted != null) {
        params.put("date_posted", JinxUtils.formatDateAsUnixTimestamp(datePosted));
      }
      if (dateTaken != null) {
        params.put("date_taken", JinxUtils.formatDateAsMySqlTimestamp(dateTaken));
      }
      if (dateTakenGranularity == 0 || dateTakenGranularity == 4 || dateTakenGranularity == 6 || dateTakenGranularity == 8) {
        params.put("date_taken_granularity", Integer.toString(dateTakenGranularity));
      }
      return jinx.flickrPost(params, Response.class);
    }
docs: Set one or both of the dates for a photo.
  <br>
  This method requires authentication with 'write' permission.
  <br>
  One or both dates can be set. If no dates are set, nothing will happen.
  <br>
  Taken dates also have a 'granularity' - the accuracy to which we know the date to be true.
  At present, the following granularities are used:
  <ul>
  <li>0 Y-m-d H:i:s</li>
  <li>4 Y-m</li>
  <li>6 Y</li>
  <li>8 Circa...</li>
  </ul>
  
  @param photoId              Required. The id of the photo to change dates for.
  @param datePosted           Optional. date the photo was uploaded to flickr
  @param dateTaken            Optional. date the photo was taken.
  @param dateTakenGranularity Optional. granularity of the date the photo was taken.
  @return response object with the result of the requested operation.
  @throws JinxException if required parameters are null or empty, or if there are any errors.
  @see <a href="https://www.flickr.com/services/api/flickr.photos.setDates.html">flickr.photos.setDates</a>