Skip to main content

Error “Illegal datetime format” when tying to parse Facebook Insights.

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2011-07-05

Trying to use OData4j to get Facebook Insights data for my page using the following code:

ODataConsumer consumer;
oentitykey = OEntityKey.parse("blahblah");
String URI = "
consumer = ODataConsumer.create(URI);
for (OEntity app : consumer.getEntities("PageMetrics")) {

I get the following exception: Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: bad keyString: datetime'2011-05-31T00%3A00%3A00' Caused by: java.lang.IllegalArgumentException: Illegal datetime format 2011-05-31T00%3A00%3A00

this is the line in the raw data that I think it is trying to parse: "end_time": "2011-05-31T07:00:00+0000"

When I use PowerPivot for Excel to display the data, it displays it fine.