I have a fairly large data model that I want to expose using Web API OData using the OData V4 protocol.
The underlying data is stored in a SQL Server 2012 database.
Since i use a library for odata with angular, i investigated it there:
https://github.com/devnixs/ODataAngularResources/blob/master/src/odatavalue.js
There you can see ( javascript)
var generateDate = function(date,isOdataV4){
if(!isOdataV4){
return "datetime'" + date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2) + "T" + ("0" + date.getHours()).slice(-2) + ":" + ("0" + date.getMinutes()).slice(-2)+':'+("0" + date.getSeconds()).slice(-2) + "'";
}else{
return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2) + "T" + ("0" + date.getHours()).slice(-2) + ":" + ("0" + date.getMinutes()).slice(-2)+':'+("0" + date.getSeconds()).slice(-2) + "Z";
}
};
And the test expects ( cfr. here )
$httpBackend.expectGET("/user(1)?$filter=date eq 2015-07-28T10:23:00Z")
So this should be your "formatting"
2015-07-28T10:23:00Z