I have a sharepoint list with one of hte columns being Created Date of Type DateTime and value allowed is OnlyDate.
The submitted date in my column is 05/18/2011. When I perform a search using the below CAML query, it does not give any results though I have two items with this date.
<Where><Eq><FieldRef Name='Date_x0020_Created' /><Value Type='DateTime'>5/18/2011</Value></Eq></Where>
I dont understand what is wrong with this query. Someone please help.
Best Answer
Sharepoint accepts datetime in ISO 8601 Datetime form in UTC. The format is
So for your example you can use
SPUtility does provide a method to do this conversion. For creating this in Java you can use the following method:
P.S. You may not be able to find both the items using this just by
<Eq>
tag as there may be time difference. For this to work you need to enclose the dates in<Leq>
and<Geq>
tags.