Got the following exception when using PhotosInterface.getCounts(null, taken_dates); method.
java.lang.NumberFormatException: For input string: "2011-06-01 00:00:00"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at com.aetrion.flickr.photos.Photocount.setFromDate(Photocount.java:47)
at com.aetrion.flickr.photos.PhotosInterface.getCounts(PhotosInterface.java:448)
at CountsInMonthView.showCounts(CountsInMonthView.java:62)
at CountsInMonthView.main(CountsInMonthView.java:88)
The exception got thrown at line number 448 of PhotosInterface.class:
photocount.setFromDate(photocountElement.getAttribute("fromdate"));
In Flickr API explorer, the response of this call is returning XML as follows:
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<photocounts>
<photocount count="0" fromdate="2009-05-05 09:46:56" todate="1955-05-19 02:18:40" />
</photocounts>
</rsp>
So that statement fails at converting the date format.
Calling the other way does work fine though: PhotosInterface.getCounts(taken_dates, null);
More accurately, the exception got thrown from Photocount.class :
public void setFromDate(String fromDate) {
if (fromDate != null) setFromDate(Long.parseLong(fromDate));
}