In Salesforce SOQL (Salesforce Object Query Language) you must use date literals not string literals for DateTime Fields. Date literals, without using quotes, need to have YYYY-MM-DD format format.
For the query for your question you can now change the conditions of your date as following:
SELECT o.CreatedDate, o.Id, o.LastModifiedDate
FROM Opportunity o
WHERE o.CreatedDate >= 2011-01-01 AND o.CreatedDate <= 2011-06-30
ORDER BY o.LastModifiedDate
Explanation:
Compare date values as YYYY-MM-DD.
Use operators with the start date, as follows: 01-01-2011 end date, 06-30-2011 opportunity creates have to be brought in using greater than or equal. Deploy the same query in Apex Explorer successfully and without any error based on the DateTime formatting.